tests: Transition back to D3D12_RESOURCE_STATE_RENDER_TARGET in d3d12_runner_probe_vec4().

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-04-11 12:18:28 -05:00 committed by Alexandre Julliard
parent 7d31fd1788
commit 02182ce4f7

View File

@ -296,8 +296,6 @@ static void d3d12_runner_draw(struct shader_runner *r,
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, test_context->rtv, clear_color, 0, NULL); ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, test_context->rtv, clear_color, 0, NULL);
ID3D12GraphicsCommandList_SetPipelineState(command_list, pso); ID3D12GraphicsCommandList_SetPipelineState(command_list, pso);
ID3D12GraphicsCommandList_DrawInstanced(command_list, vertex_count, 1, 0, 0); ID3D12GraphicsCommandList_DrawInstanced(command_list, vertex_count, 1, 0, 0);
transition_resource_state(command_list, test_context->render_target,
D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
/* Finish the command list so that we can destroy objects. */ /* Finish the command list so that we can destroy objects. */
hr = ID3D12GraphicsCommandList_Close(command_list); hr = ID3D12GraphicsCommandList_Close(command_list);
@ -314,11 +312,15 @@ static void d3d12_runner_probe_vec4(struct shader_runner *r,
struct test_context *test_context = &runner->test_context; struct test_context *test_context = &runner->test_context;
struct resource_readback rb; struct resource_readback rb;
transition_resource_state(test_context->list, test_context->render_target,
D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
get_texture_readback_with_command_list(test_context->render_target, 0, &rb, get_texture_readback_with_command_list(test_context->render_target, 0, &rb,
test_context->queue, test_context->list); test_context->queue, test_context->list);
check_readback_data_vec4(&rb, rect, v, ulps); check_readback_data_vec4(&rb, rect, v, ulps);
release_resource_readback(&rb); release_resource_readback(&rb);
reset_command_list(test_context->list, test_context->allocator); reset_command_list(test_context->list, test_context->allocator);
transition_resource_state(test_context->list, test_context->render_target,
D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET);
} }
static const struct shader_runner_ops d3d12_runner_ops = static const struct shader_runner_ops d3d12_runner_ops =