From dcc715b4d1c0e33fcab6aed345bd17b3d4a56e19 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Sat, 20 Apr 2024 13:21:18 +1000 Subject: [PATCH] tests/d3d12: Do not clear UAVs via a structured view. --- tests/d3d12.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/d3d12.c b/tests/d3d12.c index 2e69cb71..2c044322 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -23928,15 +23928,13 @@ static void test_graphics_uav_counters(void) context.pipeline_state = create_pipeline_state(context.device, context.root_signature, 0, NULL, &ps, NULL); memset(&uav_desc, 0, sizeof(uav_desc)); - uav_desc.Format = DXGI_FORMAT_UNKNOWN; + uav_desc.Format = DXGI_FORMAT_R32_UINT; uav_desc.ViewDimension = D3D12_UAV_DIMENSION_BUFFER; uav_desc.Buffer.NumElements = 64; - uav_desc.Buffer.StructureByteStride = sizeof(uint32_t); uav_desc.Buffer.Flags = D3D12_BUFFER_UAV_FLAG_NONE; ID3D12Device_CreateUnorderedAccessView(device, buffer, NULL, &uav_desc, get_cpu_descriptor_handle(&context, cpu_heap, 0)); - uav_desc.Buffer.CounterOffsetInBytes = D3D12_UAV_COUNTER_PLACEMENT_ALIGNMENT; - ID3D12Device_CreateUnorderedAccessView(device, buffer, counter_buffer, &uav_desc, + ID3D12Device_CreateUnorderedAccessView(device, buffer, NULL, &uav_desc, get_cpu_descriptor_handle(&context, gpu_heap, 0)); ID3D12GraphicsCommandList_SetDescriptorHeaps(command_list, 1, &gpu_heap); @@ -23947,6 +23945,12 @@ static void test_graphics_uav_counters(void) buffer, clear_value, 0, NULL); uav_barrier(command_list, buffer); + uav_desc.Format = DXGI_FORMAT_UNKNOWN; + uav_desc.Buffer.StructureByteStride = sizeof(uint32_t); + uav_desc.Buffer.CounterOffsetInBytes = D3D12_UAV_COUNTER_PLACEMENT_ALIGNMENT; + ID3D12Device_CreateUnorderedAccessView(device, buffer, counter_buffer, &uav_desc, + get_cpu_descriptor_handle(&context, gpu_heap, 0)); + counter = 0; upload_buffer_data(counter_buffer, uav_desc.Buffer.CounterOffsetInBytes, sizeof(counter), &counter, queue, command_list);