tests/shader_runner: Introduce the "i32" probe format.

This commit is contained in:
Henri Verbeet
2025-06-05 23:48:18 +02:00
parent 73820756d1
commit 95cf0a8b2c
Notes: Henri Verbeet 2025-06-10 18:06:45 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1555
16 changed files with 130 additions and 103 deletions

View File

@@ -800,7 +800,7 @@ static void read_int(const char **line, int *i, bool is_uniform)
if (*i != val)
fatal_error("Out of range int constant '%.*s'.\n", (int)(rest - *line), *line);
*line = rest + (!is_uniform && *rest == ',');
*line = rest;
}
static void read_uint(const char **line, unsigned int *u, bool is_uniform)
@@ -821,12 +821,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, bool is_uniform)
static void read_int4(const char **line, struct ivec4 *v)
{
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);
read_int(line, &v->x, true);
read_int(line, &v->y, true);
read_int(line, &v->z, true);
read_int(line, &v->w, true);
}
static void read_uint4(const char **line, struct uvec4 *v, bool is_uniform)
@@ -1288,6 +1288,48 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
check_readback_data_double(rb, &rect, v.x, ulps);
}
}
else if (match_string(line, "i32", &line))
{
struct ivec4 v;
if (*line != '(')
fatal_error("Malformed probe arguments '%s'.\n", line);
++line;
read_int(&line, &v.x, false);
while (isspace(*line))
++line;
if (*line == ',')
{
++line;
read_int(&line, &v.y, false);
while (isspace(*line))
++line;
if (*line != ',')
fatal_error("Malformed probe arguments '%s'.\n", line);
++line;
read_int(&line, &v.z, false);
while (isspace(*line))
++line;
if (*line != ',')
fatal_error("Malformed probe arguments '%s'.\n", line);
++line;
read_int(&line, &v.w, false);
line = close_parentheses(line);
todo_if(runner->is_todo) bug_if(runner->is_bug)
check_readback_data_ivec4(rb, &rect, &v);
}
else
{
line = close_parentheses(line);
todo_if(runner->is_todo) bug_if(runner->is_bug)
check_readback_data_uint(rb, &box, v.x, 0);
}
}
else if (match_string(line, "rgbaui", &line))
{
struct uvec4 v;
@@ -1300,18 +1342,6 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
todo_if(runner->is_todo) bug_if(runner->is_bug)
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) bug_if(runner->is_bug)
check_readback_data_ivec4(rb, &rect, &v);
}
else if (match_string(line, "rgba", &line))
{
struct vec4 v;
@@ -1336,17 +1366,14 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
todo_if(runner->is_todo) bug_if(runner->is_bug)
check_readback_data_vec2(rb, &rect, &v, ulps);
}
else if (match_string(line, "rui", &line) || (is_signed = match_string(line, "ri", &line)))
else if (match_string(line, "rui", &line))
{
unsigned int expect;
if (*line != '(')
fatal_error("Malformed probe arguments '%s'.\n", line);
++line;
if (is_signed)
read_int(&line, (int *)&expect, false);
else
read_uint(&line, &expect, false);
read_uint(&line, &expect, false);
line = close_parentheses(line);
todo_if(runner->is_todo) bug_if(runner->is_bug)
check_readback_data_uint(rb, &box, expect, 0);
@@ -1406,7 +1433,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
{
struct ivec4 v;
read_int4(&line, &v, true);
read_int4(&line, &v);
set_uniforms(runner, offset, 4, &v);
}
else if (match_string(line, "uint4", &line))