tests/shader_runner: Require explicit formats for UAV resources.

The current default is r32g32b32a32 but it requires special support
which is not available on all GPUs, so it is not a very convenient
default.

Instead of changing the default making it different from RTV resoures,
the format is required to always be explicit for UAVs.

The exceptions are counter_buffer and buffers with "stride", which don't
require a format because it is already implied.
This commit is contained in:
Francisco Casas
2024-07-31 21:48:19 -04:00
committed by Henri Verbeet
parent 738ecc9eb1
commit 164076d176
Notes: Henri Verbeet 2024-08-22 16:43:21 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/991
6 changed files with 20 additions and 2 deletions

View File

@@ -498,6 +498,8 @@ static void parse_resource_directive(struct resource_params *resource, const cha
{
resource->desc.format = parse_format(line, &resource->data_type,
&resource->desc.texel_size, &resource->is_shadow, &line);
assert_that(!resource->explicit_format, "Resource format already specified.\n");
resource->explicit_format = true;
}
else if (match_string(line, "stride", &line))
{
@@ -505,6 +507,8 @@ static void parse_resource_directive(struct resource_params *resource, const cha
fatal_error("Malformed texture stride '%s'.\n", line);
resource->desc.texel_size = resource->stride;
resource->desc.format = DXGI_FORMAT_UNKNOWN;
assert_that(!resource->explicit_format, "Resource format already specified.\n");
resource->explicit_format = true;
}
else if (match_string(line, "size", &line))
{
@@ -527,6 +531,8 @@ static void parse_resource_directive(struct resource_params *resource, const cha
resource->stride = sizeof(uint32_t);
resource->desc.texel_size = resource->stride;
resource->desc.format = DXGI_FORMAT_UNKNOWN;
assert_that(!resource->explicit_format, "Resource format already specified.\n");
resource->explicit_format = true;
}
else if (sscanf(line, "( 2d , %u , %u ) ", &resource->desc.width, &resource->desc.height) == 2)
{
@@ -1698,6 +1704,9 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_c
if (current_resource.desc.type == RESOURCE_TYPE_VERTEX_BUFFER)
current_resource.desc.width = current_resource.data_size;
if (current_resource.desc.type == RESOURCE_TYPE_UAV)
assert_that(current_resource.explicit_format, "Format must be specified for UAV resources.\n");
/* Not every backend supports every resource type
* (specifically, D3D9 doesn't support UAVs and
* textures with data type other than float). */