From 96872b941e1135ae889adb009411f4ede3fad69a Mon Sep 17 00:00:00 2001 From: Evan Tang Date: Fri, 24 Oct 2025 12:00:07 -0500 Subject: [PATCH] tests/d3d12: Add some missing UAV barriers after UAV clears. Much like e.g. commits a686fa7750b44462c18c62757aa9b897f09d5056 and 93d2bb2d5dd2077a02cd54c9ef21e2ade4add662. Direct3D 12 doesn't guarantee any implicit barriers after UAV clears, but unfortunately missing these is often easy to go unnoticed. --- tests/d3d12.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/d3d12.c b/tests/d3d12.c index 5aaef4229..6936e8276 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -7839,6 +7839,8 @@ static void test_draw_uav_only(void) ID3D12GraphicsCommandList_ClearUnorderedAccessViewFloat(command_list, gpu_handle, cpu_handle, resource, zero, 0, NULL); + uav_barrier(command_list, resource); + set_rect(&context.scissor_rect, 0, 0, 1000, 1000); set_viewport(&context.viewport, 0.0f, 0.0f, 1.0f, 100.0f, 0.0f, 0.0f); @@ -22807,6 +22809,9 @@ static void test_tgsm(void) get_cpu_descriptor_handle(&context, cpu_descriptor_heap, 1), buffer2, zero, 0, NULL); + uav_barrier(command_list, buffer); + uav_barrier(command_list, buffer2); + gpu_descriptor_handle = ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(descriptor_heap); ID3D12GraphicsCommandList_SetPipelineState(command_list, context.pipeline_state); ID3D12GraphicsCommandList_SetComputeRootSignature(command_list, context.root_signature); @@ -35281,6 +35286,8 @@ static void test_early_depth_stencil_tests(void) get_gpu_descriptor_handle(&context, gpu_heap, 0), get_cpu_descriptor_handle(&context, cpu_heap, 0), texture, values, 0, NULL); + uav_barrier(command_list, texture); + ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, ds.dsv_handle, D3D12_CLEAR_FLAG_DEPTH, 0.6f, 0, 0, NULL); ID3D12GraphicsCommandList_DrawInstanced(command_list, 3, 1, 0, 0);