From: Francisco Casas fcasas@codeweavers.com
--- tests/shader_runner.c | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 250aaa5a8..176daf983 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -851,13 +851,37 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) } else if (match_string(line, "uniform", &line)) { + bool is_d3dbc = runner->minimum_shader_model < SHADER_MODEL_4_0; + bool match_double2 = false; + bool match_float4 = false; + bool match_float = false; + bool match_uint4 = false; + bool match_uint = false; + bool match_int4 = false; + bool match_int = false; unsigned int offset;
if (!sscanf(line, "%u", &offset)) fatal_error("Malformed uniform offset '%s'.\n", line); line = strchr(line, ' ') + 1;
- if (match_string(line, "float4", &line)) + if ((match_float4 = match_string(line, "float4", &line))) + goto match_done; + if ((match_uint4 = match_string(line, "uint4", &line))) + goto match_done; + if ((match_int4 = match_string(line, "int4", &line))) + goto match_done; + if ((match_double2 = match_string(line, "double2", &line))) + goto match_done; + if ((match_float = match_string(line, "float", &line))) + goto match_done; + if ((match_uint = match_string(line, "uint", &line))) + goto match_done; + if ((match_int = match_string(line, "int", &line))) + goto match_done; + match_done: + + if (match_float4 || (is_d3dbc && (match_int4 || match_uint4))) { struct vec4 v;
@@ -865,7 +889,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) fatal_error("Malformed float4 constant '%s'.\n", line); set_uniforms(runner, offset, 4, &v); } - else if (match_string(line, "float", &line)) + else if (match_float || (is_d3dbc && (match_int || match_uint))) { float f;
@@ -873,7 +897,7 @@ 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, "double2", &line)) + else if (match_double2) { struct dvec2 v;
@@ -881,28 +905,28 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) fatal_error("Malformed double2 constant '%s'.\n", line); set_uniforms(runner, offset, 4, &v); } - else if (match_string(line, "int4", &line)) + else if (match_int4) { struct ivec4 v;
read_int4(&line, &v); set_uniforms(runner, offset, 4, &v); } - else if (match_string(line, "uint4", &line)) + else if (match_uint4) { struct uvec4 v;
read_uint4(&line, &v); set_uniforms(runner, offset, 4, &v); } - else if (match_string(line, "int", &line)) + else if (match_int) { int i;
read_int(&line, &i); set_uniforms(runner, offset, 1, &i); } - else if (match_string(line, "uint", &line)) + else if (match_uint) { unsigned int u;