From: Ethan Lee flibitijibibo@gmail.com
Signed-off-by: Ethan Lee flibitijibibo@gmail.com --- Makefile.am | 1 + tests/sign.shader_test | 45 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 tests/sign.shader_test
diff --git a/Makefile.am b/Makefile.am index 3f1ec171..93c5cf59 100644 --- a/Makefile.am +++ b/Makefile.am @@ -153,6 +153,7 @@ vkd3d_shader_tests = \ tests/saturate.shader_test \ tests/shader-interstage-interface.shader_test \ tests/side-effects.shader_test \ + tests/sign.shader_test \ tests/sqrt.shader_test \ tests/step.shader_test \ tests/swizzle-constant-prop.shader_test \ diff --git a/tests/sign.shader_test b/tests/sign.shader_test new file mode 100644 index 00000000..c63f3d35 --- /dev/null +++ b/tests/sign.shader_test @@ -0,0 +1,45 @@ +[pixel shader] +uniform float f; + +float4 main() : sv_target +{ + return sign(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) +uniform 0 float4 -1.0 0.0 0.0 0.0 +draw quad +probe all rgba (-1.0, -1.0, -1.0, -1.0) +uniform 0 float4 0.0 0.0 0.0 0.0 +draw quad +probe all rgba (0.0, 0.0, 0.0, 0.0) + +[pixel shader] +uniform float4 f; + +float4 main() : sv_target +{ + return sign(f); +} + +[test] +uniform 0 float4 1.0 2.0 3.0 4.0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[pixel shader] +uniform float2x2 f; + +float4 main() : sv_target +{ + return sign(f); +} + +[test] +uniform 0 float4 1.0 2.0 0.0 0.0 +uniform 4 float4 3.0 4.0 0.0 0.0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0)