tests: Add a test for asuint().

This commit is contained in:
Zebediah Figura
2022-09-27 13:35:16 -05:00
committed by Alexandre Julliard
parent 3d85d77ced
commit eb70f1aeb5
Notes: Alexandre Julliard 2022-10-18 00:13:00 +02: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/25
2 changed files with 63 additions and 4 deletions

View File

@@ -557,7 +557,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
unsigned int offset;
if (!sscanf(line, "%u", &offset))
fatal_error("Unknown uniform type '%s'.\n", line);
fatal_error("Malformed uniform offset '%s'.\n", line);
line = strchr(line, ' ') + 1;
if (match_string(line, "float4", &line))
@@ -576,12 +576,12 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
fatal_error("Malformed float constant '%s'.\n", line);
set_uniforms(runner, offset, 1, &f);
}
else if (match_string(line, "int4", &line))
else if (match_string(line, "int4", &line) || match_string(line, "uint4", &line))
{
int v[4];
if (sscanf(line, "%d %d %d %d", &v[0], &v[1], &v[2], &v[3]) < 4)
fatal_error("Malformed int4 constant '%s'.\n", line);
if (sscanf(line, "%i %i %i %i", &v[0], &v[1], &v[2], &v[3]) < 4)
fatal_error("Malformed (u)int4 constant '%s'.\n", line);
set_uniforms(runner, offset, 4, v);
}
else if (match_string(line, "int", &line))
@@ -600,6 +600,10 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
fatal_error("Malformed uint constant '%s'.\n", line);
set_uniforms(runner, offset, 1, &u);
}
else
{
fatal_error("Unknown uniform type '%s'.\n", line);
}
}
else
{