From: Francisco Casas fcasas@codeweavers.com
NOTE: regarding non-const-indexing.shader_test,
We probably were getting in (1.0, 1.0, 1.0, 1.0) on native because we were passing:
u: 0x00000003 0x00000001 0x00000000 0x00000002 v: 0x00000000 0x00000003 0x00000001 0x00000002
to the backend. But Direct3D expects ints in float format. This results in really small floats close or equal to zero, so when used when indexing, is if as they were 0.
Once we start passing the ints correctly formatted, the result becomes (4.0, 3.0, 2.0, 1.0), same as SM6. --- tests/hlsl/non-const-indexing.shader_test | 2 +- tests/shader_runner.c | 26 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/tests/hlsl/non-const-indexing.shader_test b/tests/hlsl/non-const-indexing.shader_test index e788caeeb..85a5d140c 100644 --- a/tests/hlsl/non-const-indexing.shader_test +++ b/tests/hlsl/non-const-indexing.shader_test @@ -244,6 +244,6 @@ uniform 12 float 4.0 uniform 16 uint4 3 1 0 2 uniform 20 uint4 0 3 1 2 todo(sm<4) draw quad -only(sm<4) todo probe all rgba (1.0, 1.0, 1.0, 1.0) +only(sm<4) todo probe all rgba (4.0, 3.0, 2.0, 1.0) only(sm>=4 & sm<6) todo probe all rgba (4.0, 4.0, 4.0, 4.0) only(sm>=6) probe all rgba (4.0, 3.0, 2.0, 1.0) diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 23a6ddd3e..8cffe20f4 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -888,6 +888,7 @@ 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; unsigned int offset;
if (!sscanf(line, "%u", &offset)) @@ -921,30 +922,55 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) else if (match_string(line, "int4", &line)) { struct ivec4 v; + struct vec4 f;
read_int4(&line, &v); + set_uniforms(runner, offset, 4, &v); + if (is_d3dbc) + { + f = (struct vec4){v.x, v.y, v.z, v.w}; + set_uniforms(runner, offset, 4, &f); + } } else if (match_string(line, "uint4", &line)) { struct uvec4 v; + struct vec4 f;
read_uint4(&line, &v); set_uniforms(runner, offset, 4, &v); + if (is_d3dbc) + { + f = (struct vec4){v.x, v.y, v.z, v.w}; + set_uniforms(runner, offset, 4, &f); + } } else if (match_string(line, "int", &line)) { + float f; int i;
read_int(&line, &i); set_uniforms(runner, offset, 1, &i); + if (is_d3dbc) + { + f = i; + set_uniforms(runner, offset, 1, &f); + } } else if (match_string(line, "uint", &line)) { unsigned int u; + float f;
read_uint(&line, &u); set_uniforms(runner, offset, 1, &u); + if (is_d3dbc) + { + f = u; + set_uniforms(runner, offset, 1, &f); + } } else if (match_string(line, "int64_t2", &line)) {