tests: Immediately transition buffers after creation in the shader runner.

The resource could be destructed before the command list left open
is executed; instead, we immediately perform the transition.
This commit is contained in:
Giovanni Mascellani
2023-10-31 14:00:35 +01:00
committed by Alexandre Julliard
parent 46b7fccfd7
commit c691ad8869
Notes: Alexandre Julliard 2023-11-01 22:40:06 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/425
2 changed files with 21 additions and 7 deletions

View File

@@ -181,11 +181,10 @@ static struct resource *d3d12_runner_create_resource(struct shader_runner *r, co
resource->resource = create_default_buffer(device, params->data_size,
D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COPY_DEST);
upload_buffer_data(resource->resource, 0, params->data_size, resource_data,
test_context->queue, test_context->list);
upload_buffer_data_with_states(resource->resource, 0, params->data_size, resource_data,
test_context->queue, test_context->list,
RESOURCE_STATE_DO_NOT_CHANGE, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
reset_command_list(test_context->list, test_context->allocator);
transition_resource_state(test_context->list, resource->resource,
D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
uav_desc.Format = params->format;
uav_desc.ViewDimension = D3D12_UAV_DIMENSION_BUFFER;