tests/shader_runner: Allow UAV resources to be created without initial data.

We can e.g. initialise these with a shader.
This commit is contained in:
Henri Verbeet
2024-02-12 20:27:52 +01:00
committed by Alexandre Julliard
parent 7d51a7d99c
commit f614d98759
Notes: Alexandre Julliard 2024-02-14 23:28:07 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/651
2 changed files with 22 additions and 8 deletions

View File

@@ -310,6 +310,15 @@ static struct resource *vulkan_runner_create_resource(struct shader_runner *r, c
usage, format, &resource->memory);
resource->image_view = create_2d_image_view(runner, resource->image, format);
if (!params->data)
{
begin_command_buffer(runner);
transition_image_layout(runner, resource->image,
VK_IMAGE_LAYOUT_UNDEFINED, layout);
end_command_buffer(runner);
break;
}
staging_buffer = create_buffer(runner, params->data_size,
VK_BUFFER_USAGE_TRANSFER_SRC_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, &staging_memory);
VK_CALL(vkMapMemory(device, staging_memory, 0, VK_WHOLE_SIZE, 0, &data));