From: Ethan Lee flibitijibibo@gmail.com
Currently only tests float and bool, scalar and vector.
Signed-off-by: Ethan Lee flibitijibibo@gmail.com --- Makefile.am | 1 + tests/any.shader_test | 124 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 tests/any.shader_test
diff --git a/Makefile.am b/Makefile.am index bff65a85..8cbd9662 100644 --- a/Makefile.am +++ b/Makefile.am @@ -44,6 +44,7 @@ vkd3d_cross_tests = \ vkd3d_shader_tests = \ tests/abs.shader_test \ tests/all.shader_test \ + tests/any.shader_test \ tests/arithmetic-float.shader_test \ tests/arithmetic-float-uniform.shader_test \ tests/arithmetic-int.shader_test \ diff --git a/tests/any.shader_test b/tests/any.shader_test new file mode 100644 index 00000000..0ab1db41 --- /dev/null +++ b/tests/any.shader_test @@ -0,0 +1,124 @@ +[require] +shader model >= 4.0 + +[pixel shader] +uniform float4 f; + +float4 main() : sv_target +{ + return any(f); +} + +[test] +uniform 0 float4 1.0 1.0 1.0 1.0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 float4 1.0 0.0 0.0 0.0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 float4 0.0 1.0 0.0 0.0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 float4 0.0 0.0 1.0 0.0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 float4 0.0 0.0 0.0 1.0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 float4 0.0 0.0 0.0 0.0 +draw quad +probe all rgba (0.0, 0.0, 0.0, 0.0) + +[test] +uniform 0 float4 -1.0 -1.0 -1.0 -1.0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[pixel shader] +uniform float f; + +float4 main() : sv_target +{ + return any(f); +} + +[test] +uniform 0 float4 1.0 0.0 0.0 0.0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 float4 0.0 0.0 0.0 0.0 +draw quad +probe all rgba (0.0, 0.0, 0.0, 0.0) + +[test] +uniform 0 float4 -1.0 0.0 0.0 0.0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[pixel shader] +uniform bool4 b; + +float4 main() : sv_target +{ + return any(b); +} + +[test] +uniform 0 uint4 1 1 1 1 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 uint4 1 0 0 0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 uint4 0 1 0 0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 uint4 0 0 1 0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 uint4 0 0 0 1 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 uint4 0 0 0 0 +draw quad +probe all rgba (0.0, 0.0, 0.0, 0.0) + +[pixel shader] +uniform bool b; + +float4 main() : sv_target +{ + return any(b); +} + +[test] +uniform 0 uint4 1 0 0 0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 uint4 0 0 0 0 +draw quad +probe all rgba (0.0, 0.0, 0.0, 0.0)