mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
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:
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
@@ -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));
|
||||
|
Reference in New Issue
Block a user