On Mon, 11 Jul 2022 at 16:27, Conor McCarthy cmccarthy@codeweavers.com wrote:
- get_buffer_readback_with_command_list(resource, uav_desc.Format, &rb, queue, command_list);
- check_readback_data_vec4(&rb.rb, NULL, &expected, 0);
- release_resource_readback(&rb);
- reset_command_list(command_list, context.allocator);
- transition_sub_resource_state(command_list, resource, 0,
D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
- ID3D12PipelineState_Release(pipeline_state);
- pipeline_state = create_compute_pipeline_state(device, root_signature,
shader_bytecode(cs_vec4_load_code, sizeof(cs_vec4_load_code)));
- ID3D12GraphicsCommandList_SetPipelineState(command_list, pipeline_state);
- ID3D12GraphicsCommandList_SetComputeRootSignature(command_list, root_signature);
- ID3D12GraphicsCommandList_SetComputeRootDescriptorTable(command_list, 0, gpu_descriptor_handle);
- ID3D12GraphicsCommandList_Dispatch(command_list, 2, 1, 1);
- transition_sub_resource_state(command_list, resource, 0,
D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COPY_SOURCE);
- get_buffer_readback_with_command_list(resource, uav_desc.Format, &rb, queue, command_list);
- todo check_readback_data_vec4(&rb.rb, NULL, &expected, 0);
- release_resource_readback(&rb);
I think still has the same issue as the previous v2; if for one reason or another the Dispatch() command is not executed, the test would succeed, because the expected value here is the same as for the preceding test, and we never clear or reinitialise the output buffer between them. The easiest way around that is likely to simply use different expected values for the two tests.