Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- v2: * Pass inputs as floats so that the test can be run also on SM1. * Use 16 instead of 15, because with SM1 it holds 5 % 15 == 4, likely because of inexact float operations. --- Makefile.am | 1 + tests/arithmetic-int-uniform.shader_test | 29 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/arithmetic-int-uniform.shader_test
diff --git a/Makefile.am b/Makefile.am index 0cb90b2b..60db7794 100644 --- a/Makefile.am +++ b/Makefile.am @@ -54,6 +54,7 @@ vkd3d_shader_tests = \ tests/abs.shader_test \ tests/arithmetic-float.shader_test \ tests/arithmetic-int.shader_test \ + tests/arithmetic-int-uniform.shader_test \ tests/arithmetic-uint.shader_test \ tests/bitwise.shader_test \ tests/cast-broadcast.shader_test \ diff --git a/tests/arithmetic-int-uniform.shader_test b/tests/arithmetic-int-uniform.shader_test new file mode 100644 index 00000000..ff80a9b0 --- /dev/null +++ b/tests/arithmetic-int-uniform.shader_test @@ -0,0 +1,29 @@ +[pixel shader] +uniform float2 a; + +float4 main() : SV_TARGET +{ + int x = a.x; + int y = a.y; + return float4(x + y, x - y, x * y, x / y); +} + +[test] +uniform 0 float4 5.0 16.0 0.0 0.0 +todo draw quad +probe all rgba (21.0, -11.0, 80.0, 0.0) + +[pixel shader] +uniform float2 a; + +float4 main() : SV_TARGET +{ + int x = a.x; + int y = a.y; + return float4(x % y, +x, -x, y / x); +} + +[test] +uniform 0 float4 5.0 16.0 0.0 0.0 +todo draw quad +probe all rgba (5.0, 5.0, -5.0, 3.0)