tests/shader-runner: Add a test for a signed int typed buffer UAV.

Check for backend type mismatches resulting from the absence of
signedness in SM 6.
This commit is contained in:
Conor McCarthy 2024-02-01 16:02:58 +10:00 committed by Alexandre Julliard
parent 081c9dbc96
commit 9180ea6591
Notes: Alexandre Julliard 2024-02-22 23:03:08 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/642
4 changed files with 40 additions and 6 deletions

View File

@ -164,6 +164,26 @@ float4 main() : sv_target1
return 0;
}
[uav 1]
format r32g32b32a32 sint
size (buffer, 2)
1 2 3 4 5 6 7 8
[pixel shader]
RWBuffer<int4> u : register(u1);
float4 main() : sv_target
{
u[0] = int4(11, -12, 13, -14);
u[1] = int4(-15, 16, -17, 18);
return 0;
}
[test]
todo(sm>=6) draw quad
probe uav 1 (0) rgbai (11, -12, 13, -14)
probe uav 1 (1) rgbai (-15, 16, -17, 18)
[uav 2]
size (buffer, 1)
0.1 0.2 0.3 0.4

View File

@ -336,6 +336,7 @@ static DXGI_FORMAT parse_format(const char *line, enum texture_data_type *data_t
formats[] =
{
{"r32g32b32a32 float", TEXTURE_DATA_FLOAT, 16, DXGI_FORMAT_R32G32B32A32_FLOAT},
{"r32g32b32a32 sint", TEXTURE_DATA_SINT, 16, DXGI_FORMAT_R32G32B32A32_SINT},
{"r32g32b32a32 uint", TEXTURE_DATA_UINT, 16, DXGI_FORMAT_R32G32B32A32_UINT},
{"r32g32 float", TEXTURE_DATA_FLOAT, 8, DXGI_FORMAT_R32G32_FLOAT},
{"r32g32 int", TEXTURE_DATA_SINT, 8, DXGI_FORMAT_R32G32_SINT},
@ -622,12 +623,12 @@ static void read_uint(const char **line, unsigned int *u, bool is_uniform)
*line = rest + (!is_uniform && *rest == ',');
}
static void read_int4(const char **line, struct ivec4 *v)
static void read_int4(const char **line, struct ivec4 *v, bool is_uniform)
{
read_int(line, &v->x, true);
read_int(line, &v->y, true);
read_int(line, &v->z, true);
read_int(line, &v->w, true);
read_int(line, &v->x, is_uniform);
read_int(line, &v->y, is_uniform);
read_int(line, &v->z, is_uniform);
read_int(line, &v->w, is_uniform);
}
static void read_uint4(const char **line, struct uvec4 *v, bool is_uniform)
@ -907,6 +908,17 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
line = close_parentheses(line);
todo_if(runner->is_todo) check_readback_data_uvec4(rb, &rect, &v);
}
else if (match_string(line, "rgbai", &line))
{
struct ivec4 v;
if (*line != '(')
fatal_error("Malformed probe arguments '%s'.\n", line);
++line;
read_int4(&line, &v, false);
line = close_parentheses(line);
todo_if(runner->is_todo) check_readback_data_ivec4(rb, &rect, &v);
}
else if (match_string(line, "rgba", &line))
{
struct vec4 v;
@ -993,7 +1005,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
{
struct ivec4 v;
read_int4(&line, &v);
read_int4(&line, &v, true);
set_uniforms(runner, offset, 4, &v);
}
else if (match_string(line, "uint4", &line))

View File

@ -293,6 +293,7 @@ static const struct format_info *get_format_info(enum DXGI_FORMAT format)
{DXGI_FORMAT_UNKNOWN, 1, true, GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT},
{DXGI_FORMAT_R32G32B32A32_FLOAT, 4, false, GL_RGBA32F, GL_RGBA, GL_FLOAT},
{DXGI_FORMAT_R32G32B32A32_UINT, 4, true, GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT},
{DXGI_FORMAT_R32G32B32A32_SINT, 4, true, GL_RGBA32I, GL_RGBA_INTEGER, GL_INT},
{DXGI_FORMAT_R32G32_FLOAT, 2, false, GL_RG32F, GL_RG, GL_FLOAT},
{DXGI_FORMAT_R32G32_UINT, 2, true, GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT},
{DXGI_FORMAT_R32G32_SINT, 2, true, GL_RG32I, GL_RG_INTEGER, GL_INT},

View File

@ -275,6 +275,7 @@ static inline void check_readback_data_vec4_(unsigned int line, const struct res
got.x, got.y, got.z, got.w, expected->x, expected->y, expected->z, expected->w, x, y);
}
#define check_readback_data_ivec4(a, b, c) check_readback_data_uvec4_(__LINE__, a, b, (const struct uvec4 *)(c))
#define check_readback_data_uvec4(a, b, c) check_readback_data_uvec4_(__LINE__, a, b, c)
static inline void check_readback_data_uvec4_(unsigned int line, const struct resource_readback *rb,
const RECT *rect, const struct uvec4 *expected)