From: Conor McCarthy <cmccarthy(a)codeweavers.com> --- tests/shader_runner.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/tests/shader_runner.c b/tests/shader_runner.c index fe5ee5972..a9a928e16 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -557,7 +557,7 @@ static void set_uniforms(struct shader_runner *runner, size_t offset, size_t cou memcpy(runner->uniforms + offset, uniforms, count * sizeof(*runner->uniforms)); } -static void read_int(const char **line, int *i) +static void read_int(const char **line, int *i, bool is_uniform) { char *rest; long val; @@ -565,7 +565,7 @@ static void read_int(const char **line, int *i) errno = 0; val = strtol(*line, &rest, 0); - if (errno != 0 || (*rest != '\0' && !isspace((unsigned char)*rest))) + if (errno != 0 || (is_uniform && *rest != '\0' && !isspace((unsigned char)*rest))) fatal_error("Malformed int constant '%s'.\n", *line); *i = val; @@ -595,10 +595,10 @@ static void read_uint(const char **line, unsigned int *u, bool is_uniform) static void read_int4(const char **line, struct ivec4 *v) { - read_int(line, &v->x); - read_int(line, &v->y); - read_int(line, &v->z); - read_int(line, &v->w); + 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) @@ -774,6 +774,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) unsigned int left, top, right, bottom, ulps, slot; struct resource_readback *rb; struct resource *resource; + bool is_signed = false; RECT rect; int len; @@ -858,7 +859,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) ulps = 0; todo_if(runner->is_todo) check_readback_data_vec4(rb, &rect, &v, ulps); } - else if (match_string(line, "rui", &line)) + else if (match_string(line, "rui", &line) || (is_signed = match_string(line, "ri", &line))) { unsigned int expect; D3D12_BOX box; @@ -872,7 +873,10 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) if (*line != '(') fatal_error("Malformed probe arguments '%s'.\n", line); ++line; - read_uint(&line, &expect, false); + if (is_signed) + read_int(&line, (int *)&expect, false); + else + read_uint(&line, &expect, false); line = close_parentheses(line); todo_if(runner->is_todo) check_readback_data_uint(rb, &box, expect, 0); } @@ -944,7 +948,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) { int i; - read_int(&line, &i); + read_int(&line, &i, true); set_uniforms(runner, offset, 1, &i); } else if (match_string(line, "uint", &line)) -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/645