Partly to make the tests easier to navigate, and partly to allow marking some tests as SM4+.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- Makefile.am | 12 +- tests/arithmetic-float.shader_test | 25 ++ tests/arithmetic-int.shader_test | 25 ++ tests/arithmetic-uint.shader_test | 25 ++ tests/bitwise.shader_test | 129 ++++++++++ tests/hlsl-operations.shader_test | 367 ----------------------------- tests/logic-operations.shader_test | 158 +++++++++++++ 7 files changed, 372 insertions(+), 369 deletions(-) create mode 100644 tests/arithmetic-float.shader_test create mode 100644 tests/arithmetic-int.shader_test create mode 100644 tests/arithmetic-uint.shader_test create mode 100644 tests/bitwise.shader_test delete mode 100644 tests/hlsl-operations.shader_test create mode 100644 tests/logic-operations.shader_test
diff --git a/Makefile.am b/Makefile.am index d4402910c..79aacfcd6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -52,6 +52,10 @@ vkd3d_cross_tests = \
vkd3d_shader_tests = \ tests/abs.shader_test \ + tests/arithmetic-float.shader_test \ + tests/arithmetic-int.shader_test \ + tests/arithmetic-uint.shader_test \ + tests/bitwise.shader_test \ tests/cast-to-float.shader_test \ tests/cast-to-half.shader_test \ tests/cast-to-int.shader_test \ @@ -85,7 +89,6 @@ vkd3d_shader_tests = \ tests/hlsl-nested-arrays.shader_test \ tests/hlsl-numeric-constructor-truncation.shader_test \ tests/hlsl-numeric-types.shader_test \ - tests/hlsl-operations.shader_test \ tests/hlsl-return-implicit-conversion.shader_test \ tests/hlsl-return-void.shader_test \ tests/hlsl-shape.shader_test \ @@ -97,6 +100,7 @@ vkd3d_shader_tests = \ tests/hlsl-struct-semantics.shader_test \ tests/hlsl-vector-indexing.shader_test \ tests/hlsl-vector-indexing-uniform.shader_test \ + tests/logic-operations.shader_test \ tests/math.shader_test \ tests/pow.shader_test \ tests/preproc-if.shader_test \ @@ -309,6 +313,10 @@ tests_vkd3d_api_LDADD = libvkd3d.la @VULKAN_LIBS@ tests_vkd3d_shader_api_LDADD = libvkd3d-shader.la SHADER_TEST_LOG_COMPILER = tests/shader_runner XFAIL_TESTS = \ + tests/arithmetic-float.shader_test \ + tests/arithmetic-int.shader_test \ + tests/arithmetic-uint.shader_test \ + tests/bitwise.shader_test \ tests/cast-to-float.shader_test \ tests/cast-to-half.shader_test \ tests/cast-to-int.shader_test \ @@ -334,7 +342,6 @@ XFAIL_TESTS = \ tests/hlsl-nested-arrays.shader_test \ tests/hlsl-numeric-constructor-truncation.shader_test \ tests/hlsl-numeric-types.shader_test \ - tests/hlsl-operations.shader_test \ tests/hlsl-return-implicit-conversion.shader_test \ tests/hlsl-return-void.shader_test \ tests/hlsl-shape.shader_test \ @@ -342,6 +349,7 @@ XFAIL_TESTS = \ tests/hlsl-storage-qualifiers.shader_test \ tests/hlsl-vector-indexing.shader_test \ tests/hlsl-vector-indexing-uniform.shader_test \ + tests/logic-operations.shader_test \ tests/max.shader_test \ tests/sampler-offset.shader_test \ tests/trigonometry.shader_test diff --git a/tests/arithmetic-float.shader_test b/tests/arithmetic-float.shader_test new file mode 100644 index 000000000..dcda1bcf8 --- /dev/null +++ b/tests/arithmetic-float.shader_test @@ -0,0 +1,25 @@ +[pixel shader] +float4 main() : SV_TARGET +{ + float x = 5.0; + float y = 15.0; + + return float4(x + y, x - y, x * y, x / y); +} + +[test] +draw quad +probe all rgba (20.0, -10.0, 75.0, 0.33333333) + +[pixel shader] +float4 main() : SV_TARGET +{ + float x = 5.0; + float y = 15.0; + + return float4(x % y, +x, -x, y / x); +} + +[test] +draw quad +probe all rgba (5.0, 5.0, -5.0, 3.0) diff --git a/tests/arithmetic-int.shader_test b/tests/arithmetic-int.shader_test new file mode 100644 index 000000000..959f94033 --- /dev/null +++ b/tests/arithmetic-int.shader_test @@ -0,0 +1,25 @@ +[pixel shader] +float4 main() : SV_TARGET +{ + int x = 5; + int y = 15; + + return float4(x + y, x - y, x * y, x / y); +} + +[test] +draw quad +probe all rgba (20.0, -10.0, 75.0, 0.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + int x = 5; + int y = 15; + + return float4(x % y, +x, -x, y / x); +} + +[test] +draw quad +probe all rgba (5.0, 5.0, -5.0, 3.0) diff --git a/tests/arithmetic-uint.shader_test b/tests/arithmetic-uint.shader_test new file mode 100644 index 000000000..d73947f9f --- /dev/null +++ b/tests/arithmetic-uint.shader_test @@ -0,0 +1,25 @@ +[pixel shader] +float4 main() : SV_TARGET +{ + uint x = 5; + uint y = 15; + + return float4(x + y, x - y, x * y, x / y); +} + +[test] +draw quad +probe all rgba (20.0, 4294967296.0, 75.0, 0.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + uint x = 5; + uint y = 15; + + return float4(x % y, +x, -x, y / x); +} + +[test] +draw quad +probe all rgba (5.0, 5.0, 4294967296.0, 3.0) diff --git a/tests/bitwise.shader_test b/tests/bitwise.shader_test new file mode 100644 index 000000000..679cf9cd9 --- /dev/null +++ b/tests/bitwise.shader_test @@ -0,0 +1,129 @@ +[pixel shader] +float4 main() : SV_TARGET +{ + int x = 5; + int y = 15; + + return float4(x >> y, y >> x, x << y, y << x); +} + +[test] +draw quad +probe all rgba (0.0, 0.0, 163840.0, 480.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + int x = 5; + int y = 15; + + return float4(x & y, x | y, x ^ y, ~x); +} + +[test] +draw quad +probe all rgba (5.0, 15.0, 10.0, -6.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + int zero = 0; + int one = 1; + + return float4(zero & zero, zero & one, one & zero, one & one); +} + +[test] +draw quad +probe all rgba (0.0, 0.0, 0.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + int zero = 0; + int one = 1; + + return float4(zero | zero, zero | one, one | zero, one | one); +} + +[test] +draw quad +probe all rgba (0.0, 1.0, 1.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + int zero = 0; + int one = 1; + + return float4(zero ^ zero, zero ^ one, one ^ zero, one ^ one); +} + +[test] +draw quad +probe all rgba (0.0, 1.0, 1.0, 0.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + uint x = 5; + uint y = 15; + + return float4(x >> y, y >> x, x << y, y << x); +} + +[test] +draw quad +probe all rgba (0.0, 0.0, 163840.0, 480.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + uint x = 5; + uint y = 15; + + return float4(x & y, x | y, x ^ y, ~x); +} + +[test] +draw quad +probe all rgba (5.0, 15.0, 10.0, 4294967296.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + uint zero = 0; + uint one = 1; + + return float4(zero & zero, zero & one, one & zero, one & one); +} + +[test] +draw quad +probe all rgba (0.0, 0.0, 0.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + uint zero = 0; + uint one = 1; + + return float4(zero | zero, zero | one, one | zero, one | one); +} + +[test] +draw quad +probe all rgba (0.0, 1.0, 1.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + uint zero = 0; + uint one = 1; + + return float4(zero ^ zero, zero ^ one, one ^ zero, one ^ one); +} + +[test] +draw quad +probe all rgba (0.0, 1.0, 1.0, 0.0) diff --git a/tests/hlsl-operations.shader_test b/tests/hlsl-operations.shader_test deleted file mode 100644 index 09846b18f..000000000 --- a/tests/hlsl-operations.shader_test +++ /dev/null @@ -1,367 +0,0 @@ - -[pixel shader] -float4 main() : SV_TARGET -{ - float x = 5.0; - float y = 15.0; - - return float4(x + y, x - y, x * y, x / y); -} - -[test] -draw quad -probe all rgba (20.0, -10.0, 75.0, 0.33333333) - -[pixel shader] -float4 main() : SV_TARGET -{ - float x = 5.0; - float y = 15.0; - - return float4(x % y, +x, -x, y / x); -} - -[test] -draw quad -probe all rgba (5.0, 5.0, -5.0, 3.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - float x = 5.0; - float y = 15.0; - - return float4(x == y, x != y, x < y, x <= y); -} - -[test] -draw quad -probe all rgba (0.0, 1.0, 1.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - float x = 5.0; - float y = 15.0; - float zero = 0.0; - - return float4(x > y, x >= y, !x, !zero); -} - -[test] -draw quad -probe all rgba (0.0, 0.0, 0.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - float zero = 0.0; - float one = 1.0; - - return float4(zero && zero, zero && one, one && zero, one && one); -} - -[test] -draw quad -probe all rgba (0.0, 0.0, 0.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - float zero = 0.0; - float one = 1.0; - - return float4(zero || zero, zero || one, one || zero, one || one); -} - -[test] -draw quad -probe all rgba (0.0, 1.0, 1.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - int x = 5; - int y = 15; - - return float4(x + y, x - y, x * y, x / y); -} - -[test] -draw quad -probe all rgba (20.0, -10.0, 75.0, 0.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - int x = 5; - int y = 15; - - return float4(x % y, +x, -x, y / x); -} - -[test] -draw quad -probe all rgba (5.0, 5.0, -5.0, 3.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - int x = 5; - int y = 15; - - return float4(x == y, x != y, x < y, x <= y); -} - -[test] -draw quad -probe all rgba (0.0, 1.0, 1.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - int x = 5; - int y = 15; - int zero = 0; - - return float4(x > y, x >= y, !x, !zero); -} - -[test] -draw quad -probe all rgba (0.0, 0.0, 0.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - int x = 5; - int y = 15; - - return float4(x >> y, y >> x, x << y, y << x); -} - -[test] -draw quad -probe all rgba (0.0, 0.0, 163840.0, 480.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - int x = 5; - int y = 15; - - return float4(x & y, x | y, x ^ y, ~x); -} - -[test] -draw quad -probe all rgba (5.0, 15.0, 10.0, -6.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - int zero = 0; - int one = 1; - - return float4(zero && zero, zero && one, one && zero, one && one); -} - -[test] -draw quad -probe all rgba (0.0, 0.0, 0.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - int zero = 0; - int one = 1; - - return float4(zero || zero, zero || one, one || zero, one || one); -} - -[test] -draw quad -probe all rgba (0.0, 1.0, 1.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - int zero = 0; - int one = 1; - - return float4(zero & zero, zero & one, one & zero, one & one); -} - -[test] -draw quad -probe all rgba (0.0, 0.0, 0.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - int zero = 0; - int one = 1; - - return float4(zero | zero, zero | one, one | zero, one | one); -} - -[test] -draw quad -probe all rgba (0.0, 1.0, 1.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - int zero = 0; - int one = 1; - - return float4(zero ^ zero, zero ^ one, one ^ zero, one ^ one); -} - -[test] -draw quad -probe all rgba (0.0, 1.0, 1.0, 0.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - uint x = 5; - uint y = 15; - - return float4(x + y, x - y, x * y, x / y); -} - -[test] -draw quad -probe all rgba (20.0, 4294967296.0, 75.0, 0.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - uint x = 5; - uint y = 15; - - return float4(x % y, +x, -x, y / x); -} - -[test] -draw quad -probe all rgba (5.0, 5.0, 4294967296.0, 3.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - uint x = 5; - uint y = 15; - - return float4(x == y, x != y, x < y, x <= y); -} - -[test] -draw quad -probe all rgba (0.0, 1.0, 1.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - uint x = 5; - uint y = 15; - uint zero = 0; - - return float4(x > y, x >= y, !x, !zero); -} - -[test] -draw quad -probe all rgba (0.0, 0.0, 0.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - uint x = 5; - uint y = 15; - - return float4(x >> y, y >> x, x << y, y << x); -} - -[test] -draw quad -probe all rgba (0.0, 0.0, 163840.0, 480.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - uint x = 5; - uint y = 15; - - return float4(x & y, x | y, x ^ y, ~x); -} - -[test] -draw quad -probe all rgba (5.0, 15.0, 10.0, 4294967296.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - uint zero = 0; - uint one = 1; - - return float4(zero && zero, zero && one, one && zero, one && one); -} - -[test] -draw quad -probe all rgba (0.0, 0.0, 0.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - uint zero = 0; - uint one = 1; - - return float4(zero || zero, zero || one, one || zero, one || one); -} - -[test] -draw quad -probe all rgba (0.0, 1.0, 1.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - uint zero = 0; - uint one = 1; - - return float4(zero & zero, zero & one, one & zero, one & one); -} - -[test] -draw quad -probe all rgba (0.0, 0.0, 0.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - uint zero = 0; - uint one = 1; - - return float4(zero | zero, zero | one, one | zero, one | one); -} - -[test] -draw quad -probe all rgba (0.0, 1.0, 1.0, 1.0) - -[pixel shader] -float4 main() : SV_TARGET -{ - uint zero = 0; - uint one = 1; - - return float4(zero ^ zero, zero ^ one, one ^ zero, one ^ one); -} - -[test] -draw quad -probe all rgba (0.0, 1.0, 1.0, 0.0) diff --git a/tests/logic-operations.shader_test b/tests/logic-operations.shader_test new file mode 100644 index 000000000..360ca03b3 --- /dev/null +++ b/tests/logic-operations.shader_test @@ -0,0 +1,158 @@ +[pixel shader] +float4 main() : SV_TARGET +{ + float x = 5.0; + float y = 15.0; + + return float4(x == y, x != y, x < y, x <= y); +} + +[test] +draw quad +probe all rgba (0.0, 1.0, 1.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + float x = 5.0; + float y = 15.0; + float zero = 0.0; + + return float4(x > y, x >= y, !x, !zero); +} + +[test] +draw quad +probe all rgba (0.0, 0.0, 0.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + float zero = 0.0; + float one = 1.0; + + return float4(zero && zero, zero && one, one && zero, one && one); +} + +[test] +draw quad +probe all rgba (0.0, 0.0, 0.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + float zero = 0.0; + float one = 1.0; + + return float4(zero || zero, zero || one, one || zero, one || one); +} + +[test] +draw quad +probe all rgba (0.0, 1.0, 1.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + int x = 5; + int y = 15; + + return float4(x == y, x != y, x < y, x <= y); +} + +[test] +draw quad +probe all rgba (0.0, 1.0, 1.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + int x = 5; + int y = 15; + int zero = 0; + + return float4(x > y, x >= y, !x, !zero); +} + +[test] +draw quad +probe all rgba (0.0, 0.0, 0.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + int zero = 0; + int one = 1; + + return float4(zero && zero, zero && one, one && zero, one && one); +} + +[test] +draw quad +probe all rgba (0.0, 0.0, 0.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + int zero = 0; + int one = 1; + + return float4(zero || zero, zero || one, one || zero, one || one); +} + +[test] +draw quad +probe all rgba (0.0, 1.0, 1.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + uint x = 5; + uint y = 15; + + return float4(x == y, x != y, x < y, x <= y); +} + +[test] +draw quad +probe all rgba (0.0, 1.0, 1.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + uint x = 5; + uint y = 15; + uint zero = 0; + + return float4(x > y, x >= y, !x, !zero); +} + +[test] +draw quad +probe all rgba (0.0, 0.0, 0.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + uint zero = 0; + uint one = 1; + + return float4(zero && zero, zero && one, one && zero, one && one); +} + +[test] +draw quad +probe all rgba (0.0, 0.0, 0.0, 1.0) + +[pixel shader] +float4 main() : SV_TARGET +{ + uint zero = 0; + uint one = 1; + + return float4(zero || zero, zero || one, one || zero, one || one); +} + +[test] +draw quad +probe all rgba (0.0, 1.0, 1.0, 1.0)
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- tests/round.shader_test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/round.shader_test b/tests/round.shader_test index cc5a69751..59ac62d55 100644 --- a/tests/round.shader_test +++ b/tests/round.shader_test @@ -5,9 +5,9 @@ float4 main(uniform float4 u) : sv_target }
[test] -uniform 0 float4 -0.5 6.5 7.5 3.4 +uniform 0 float4 -0.4 -6.6 7.6 3.4 draw quad -probe all rgba (0.0, 6.0, 8.0, 3.0) 4 +probe all rgba (0.0, -7.0, 8.0, 3.0) 4
@@ -21,9 +21,9 @@ float4 main(uniform float4 u) : sv_target }
[test] -uniform 0 float4 -0.5 6.5 7.5 3.4 +uniform 0 float4 -0.4 -6.6 7.6 3.4 draw quad -probe all rgba (6.0, 8.0, 0.0, 3.0) 4 +probe all rgba (-7.0, 8.0, 0.0, 3.0) 4
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- tests/hlsl-clamp.shader_test | 4 ++-- tests/hlsl-storage-qualifiers.shader_test | 7 ++++--- tests/math.shader_test | 4 ++-- tests/max.shader_test | 8 ++++---- tests/pow.shader_test | 4 ++-- 5 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/tests/hlsl-clamp.shader_test b/tests/hlsl-clamp.shader_test index 73f396fff..8e26270c6 100644 --- a/tests/hlsl-clamp.shader_test +++ b/tests/hlsl-clamp.shader_test @@ -1,7 +1,7 @@ [pixel shader] -float4 main(uniform float u, uniform float v, uniform float w) : sv_target +float4 main(uniform float3 u) : sv_target { - return float4(clamp(u, v, w), clamp(0.9, v, w), clamp(u, -0.5, w), clamp(0.6, -0.4, 0.3)); + return float4(clamp(u.x, u.y, u.z), clamp(0.9, u.y, u.z), clamp(u.x, -0.5, u.z), clamp(0.6, -0.4, 0.3)); }
[test] diff --git a/tests/hlsl-storage-qualifiers.shader_test b/tests/hlsl-storage-qualifiers.shader_test index 0e22bb6f7..00e7b8367 100644 --- a/tests/hlsl-storage-qualifiers.shader_test +++ b/tests/hlsl-storage-qualifiers.shader_test @@ -9,12 +9,13 @@ void sub(float a, uniform float b, in float c, uniform in float d, out float4 o) sub2(float4(a, b, c, d), o); }
-void main(in uniform float a, uniform float b, out float4 o : sv_target) +void main(in uniform float4 a, uniform float4 b, out float4 o : sv_target) { - sub(a, b, 0.3, 0.4, o); + sub(a.x, b.x, 0.3, 0.4, o); }
[test] -uniform 0 float4 0.1 0.2 0.0 0.0 +uniform 0 float4 0.1 0.0 0.0 0.0 +uniform 4 float4 0.2 0.0 0.0 0.0 draw quad probe all rgba (0.1, 0.2, 0.3, 0.4) diff --git a/tests/math.shader_test b/tests/math.shader_test index 2fe59a082..6bd9656d8 100644 --- a/tests/math.shader_test +++ b/tests/math.shader_test @@ -1,7 +1,7 @@ [pixel shader] -float4 main(uniform float u, uniform float v, uniform float w, uniform float x, - uniform float y, uniform float z) : SV_TARGET +float4 main(uniform float4 a, uniform float2 b) : SV_TARGET { + float u = a.x, v = a.y, w = a.z, x = a.w, y = b.x, z = b.y; return float4(x * y - z / w + --u / -v, z * x / y + w / -v, u + v - w, diff --git a/tests/max.shader_test b/tests/max.shader_test index 56c9a84e6..50083f339 100644 --- a/tests/max.shader_test +++ b/tests/max.shader_test @@ -1,7 +1,7 @@ [pixel shader] -float4 main(uniform float u, uniform float v) : sv_target +float4 main(uniform float2 u) : sv_target { - return float4(max(u, v), max(2, 2.1), max(true, 2), max(-1, -1)); + return float4(max(u.x, u.y), max(2, 2.1), max(true, 2), max(-1, -1)); }
[test] @@ -10,11 +10,11 @@ draw quad probe all rgba (0.7, 2.1, 2.0, -1.0)
[pixel shader] -float4 main(uniform float2 u, uniform float2 v) : sv_target +float4 main(uniform float4 u) : sv_target { float3 a = float3(-0.1, 0.2, 0.3);
- return float4(max(u, v), max(a, u)); + return float4(max(u.xy, u.zw), max(a, u.xy)); }
[test] diff --git a/tests/pow.shader_test b/tests/pow.shader_test index 21011e6c0..6470494e2 100644 --- a/tests/pow.shader_test +++ b/tests/pow.shader_test @@ -1,7 +1,7 @@ [pixel shader] -float4 main(uniform float2 u, uniform float2 v) : sv_target +float4 main(uniform float4 u) : sv_target { - return float4(pow(u.y, 3), pow(u, v), pow(0.5, v.y)); + return float4(pow(u.y, 3), pow(u.xy, u.zw), pow(0.5, u.w)); }
[test]
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
SM1 encodes these differently.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- tests/hlsl-vector-indexing-uniform.shader_test | 4 ++-- tests/round.shader_test | 7 ++++--- tests/saturate.shader_test | 7 ++++--- 3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/tests/hlsl-vector-indexing-uniform.shader_test b/tests/hlsl-vector-indexing-uniform.shader_test index 26a458796..e5ffbdd02 100644 --- a/tests/hlsl-vector-indexing-uniform.shader_test +++ b/tests/hlsl-vector-indexing-uniform.shader_test @@ -1,7 +1,7 @@ % Use a uniform to prevent the compiler from optimizing.
[pixel shader] -uniform int i; +uniform float i; float4 main() : SV_TARGET { float4 color = float4(0.5, 0.4, 0.3, 0.2); @@ -11,6 +11,6 @@ float4 main() : SV_TARGET }
[test] -uniform 0 uint 2 +uniform 0 float 2 draw quad probe all rgba (0.5, 0.3, 0.8, 0.2) diff --git a/tests/round.shader_test b/tests/round.shader_test index 59ac62d55..5e40dc6dd 100644 --- a/tests/round.shader_test +++ b/tests/round.shader_test @@ -28,12 +28,13 @@ probe all rgba (-7.0, 8.0, 0.0, 3.0) 4
[pixel shader] -float4 main(uniform int4 u) : sv_target +float4 main(uniform float4 u) : sv_target { - return round(u); + int4 i = u; + return round(i); }
[test] -uniform 0 int4 -1 0 2 10 +uniform 0 float4 -1 0 2 10 draw quad probe all rgba (-1.0, 0.0, 2.0, 10.0) 4 diff --git a/tests/saturate.shader_test b/tests/saturate.shader_test index e99df5b3b..41ccc62ae 100644 --- a/tests/saturate.shader_test +++ b/tests/saturate.shader_test @@ -10,12 +10,13 @@ draw quad probe all rgba (0.7, 0.0, 1.0, 0.0)
[pixel shader] -float4 main(uniform int4 u) : sv_target +float4 main(uniform float4 u) : sv_target { - return saturate(u); + int4 i = u; + return saturate(i); }
[test] -uniform 0 int4 -2 0 2 -1 +uniform 0 float4 -2 0 2 -1 draw quad probe all rgba (0.0, 0.0, 1.0, 0.0)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- tests/arithmetic-uint.shader_test | 3 +++ tests/bitwise.shader_test | 3 +++ tests/cast-to-float.shader_test | 4 +++- tests/cast-to-half.shader_test | 3 +++ tests/cast-to-int.shader_test | 3 +++ tests/cast-to-uint.shader_test | 3 +++ tests/floor.shader_test | 3 +++ tests/hlsl-function-cast.shader_test | 3 +++ tests/sampler-offset.shader_test | 3 +++ tests/shader_runner.c | 3 +++ tests/shader_runner.h | 3 ++- tests/shader_runner_d3d11.c | 1 + tests/shader_runner_d3d12.c | 1 + 13 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/tests/arithmetic-uint.shader_test b/tests/arithmetic-uint.shader_test index d73947f9f..b016dbb6a 100644 --- a/tests/arithmetic-uint.shader_test +++ b/tests/arithmetic-uint.shader_test @@ -1,3 +1,6 @@ +[require] +shader model >= 4.0 + [pixel shader] float4 main() : SV_TARGET { diff --git a/tests/bitwise.shader_test b/tests/bitwise.shader_test index 679cf9cd9..551600370 100644 --- a/tests/bitwise.shader_test +++ b/tests/bitwise.shader_test @@ -1,3 +1,6 @@ +[require] +shader model >= 4.0 + [pixel shader] float4 main() : SV_TARGET { diff --git a/tests/cast-to-float.shader_test b/tests/cast-to-float.shader_test index 75822e527..f09100204 100644 --- a/tests/cast-to-float.shader_test +++ b/tests/cast-to-float.shader_test @@ -1,5 +1,7 @@ -[pixel shader] +[require] +shader model >= 4.0
+[pixel shader] float4 main(uniform int i, uniform uint u, uniform bool b, uniform half h) : sv_target { return float4(((float)i) + 1.5, ((float)u) - 2.5, ((float)b) / 2, h); diff --git a/tests/cast-to-half.shader_test b/tests/cast-to-half.shader_test index 6db5412de..81d6bc5d5 100644 --- a/tests/cast-to-half.shader_test +++ b/tests/cast-to-half.shader_test @@ -1,3 +1,6 @@ +[require] +shader model >= 4.0 + [pixel shader]
float4 main(uniform int i, uniform uint u, uniform bool b, uniform float f) : sv_target diff --git a/tests/cast-to-int.shader_test b/tests/cast-to-int.shader_test index c7d1e23c3..fe8c79a3c 100644 --- a/tests/cast-to-int.shader_test +++ b/tests/cast-to-int.shader_test @@ -1,3 +1,6 @@ +[require] +shader model >= 4.0 + [pixel shader]
float4 main(uniform float f, uniform uint u, uniform bool b, uniform half h) : sv_target diff --git a/tests/cast-to-uint.shader_test b/tests/cast-to-uint.shader_test index 01b0442cf..93862a36f 100644 --- a/tests/cast-to-uint.shader_test +++ b/tests/cast-to-uint.shader_test @@ -1,3 +1,6 @@ +[require] +shader model >= 4.0 + [pixel shader]
float4 main(uniform float f, uniform int i, uniform bool b, uniform half h) : sv_target diff --git a/tests/floor.shader_test b/tests/floor.shader_test index 033d759ca..c111f98b9 100644 --- a/tests/floor.shader_test +++ b/tests/floor.shader_test @@ -23,6 +23,9 @@ uniform 0 float4 -0.5 6.5 7.5 3.4 draw quad probe all rgba (6.0, 7.0, -1.0, 3.0) 4
+[require] +shader model >= 4.0 + [pixel shader] float4 main(uniform int4 u) : sv_target { diff --git a/tests/hlsl-function-cast.shader_test b/tests/hlsl-function-cast.shader_test index 4f80ac596..41c452e5f 100644 --- a/tests/hlsl-function-cast.shader_test +++ b/tests/hlsl-function-cast.shader_test @@ -67,6 +67,9 @@ uniform 0 float4 -1.9 -1.0 2.9 4.0 draw quad probe all rgba (-1.0, -1.0, 2.0, 4.0)
+[require] +shader model >= 4.0 + [pixel shader]
void func(inout float4 a) diff --git a/tests/sampler-offset.shader_test b/tests/sampler-offset.shader_test index 83900c55e..6f8357dfa 100644 --- a/tests/sampler-offset.shader_test +++ b/tests/sampler-offset.shader_test @@ -1,3 +1,6 @@ +[require] +shader model >= 4.0 + [sampler 0] filter point point point address clamp clamp clamp diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 558d074d7..1808a581b 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -105,6 +105,7 @@ static void parse_require_directive(struct shader_context *context, const char * { static const char *const model_strings[] = { + [SHADER_MODEL_2_0] = "2.0", [SHADER_MODEL_4_0] = "4.0", [SHADER_MODEL_4_1] = "4.1", [SHADER_MODEL_5_0] = "5.0", @@ -445,6 +446,8 @@ void run_shader_tests(struct shader_context *context, int argc, char **argv, con char line[256]; FILE *f;
+ context->minimum_shader_model = SHADER_MODEL_2_0; + for (i = 1; i < argc; ++i) { if (argv[i][0] != '-') diff --git a/tests/shader_runner.h b/tests/shader_runner.h index 245ef358f..822a863f1 100644 --- a/tests/shader_runner.h +++ b/tests/shader_runner.h @@ -25,7 +25,8 @@
enum shader_model { - SHADER_MODEL_4_0 = 0, + SHADER_MODEL_2_0, + SHADER_MODEL_4_0, SHADER_MODEL_4_1, SHADER_MODEL_5_0, SHADER_MODEL_5_1, diff --git a/tests/shader_runner_d3d11.c b/tests/shader_runner_d3d11.c index d77a4b246..79f98640e 100644 --- a/tests/shader_runner_d3d11.c +++ b/tests/shader_runner_d3d11.c @@ -441,6 +441,7 @@ static void d3d11_runner_draw_quad(struct shader_context *c)
static const char *const ps_profiles[] = { + [SHADER_MODEL_2_0] = "ps_4_0", [SHADER_MODEL_4_0] = "ps_4_0", [SHADER_MODEL_4_1] = "ps_4_1", [SHADER_MODEL_5_0] = "ps_5_0", diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index 3b415ec76..00bb9e414 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -58,6 +58,7 @@ static ID3D10Blob *compile_shader(const char *source, enum shader_model shader_m
static const char *const shader_models[] = { + [SHADER_MODEL_2_0] = "ps_4_0", [SHADER_MODEL_4_0] = "ps_4_0", [SHADER_MODEL_4_1] = "ps_4_1", [SHADER_MODEL_5_0] = "ps_5_0",
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com