From: Giovanni Mascellani gmascellani@codeweavers.com
There is no guarantee that a resource is cleared upon creation. This fixes the test on NVIDIA and llvmpipe. --- tests/hlsl_d3d12.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/tests/hlsl_d3d12.c b/tests/hlsl_d3d12.c index b2273ffbc..b13242562 100644 --- a/tests/hlsl_d3d12.c +++ b/tests/hlsl_d3d12.c @@ -516,10 +516,16 @@ static void test_thread_id(void)
for (i = 0; i < 3; ++i) { + const UINT clear_value[4] = {0}; + textures[i] = create_default_texture3d(device, 16, 8, 8, 1, DXGI_FORMAT_R32G32B32A32_UINT, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_UNORDERED_ACCESS); ID3D12Device_CreateUnorderedAccessView(device, textures[i], NULL, NULL, get_cpu_descriptor_handle(&context, heap, i)); + ID3D12GraphicsCommandList_ClearUnorderedAccessViewUint(command_list, + get_gpu_descriptor_handle(&context, heap, i), + get_cpu_descriptor_handle(&context, heap, i), + textures[i], clear_value, 0, NULL); }
cs_code = compile_shader(cs_source, "cs_5_0");