Module: vkd3d Branch: master Commit: 109f7094bc75e7b6ec7ee5be86997008df2bd6bf URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/109f7094bc75e7b6ec7ee5be869970...
Author: Ethan Lee flibitijibibo@gmail.com Date: Fri Apr 21 16:14:46 2023 -0400
tests: Add tests for sign() intrinsic.
Signed-off-by: Ethan Lee flibitijibibo@gmail.com
---
Makefile.am | 1 + tests/sign.shader_test | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+)
diff --git a/Makefile.am b/Makefile.am index b689d12e..e3d52ac5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -157,6 +157,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..dc1a557f --- /dev/null +++ b/tests/sign.shader_test @@ -0,0 +1,91 @@ +[pixel shader notimpl] +uniform float f; + +float4 main() : sv_target +{ + return sign(f); +} + +[test] +uniform 0 float4 1.0 0.0 0.0 0.0 +todo draw quad +todo probe all rgba (1.0, 1.0, 1.0, 1.0) +uniform 0 float4 -1.0 0.0 0.0 0.0 +todo draw quad +todo probe all rgba (-1.0, -1.0, -1.0, -1.0) +uniform 0 float4 0.0 0.0 0.0 0.0 +todo draw quad +todo probe all rgba (0.0, 0.0, 0.0, 0.0) + +[pixel shader notimpl] +uniform float4 f; + +float4 main() : sv_target +{ + return sign(f); +} + +[test] +uniform 0 float4 1.0 2.0 3.0 4.0 +todo draw quad +todo probe all rgba (1.0, 1.0, 1.0, 1.0) + +[pixel shader notimpl] +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 +todo draw quad +todo probe all rgba (1.0, 1.0, 1.0, 1.0) + +[pixel shader notimpl] +uniform int f; + +float4 main() : sv_target +{ + return sign(f); +} + +[test] +uniform 0 int4 1 0 0 0 +todo draw quad +todo probe all rgba (1, 1, 1, 1) +uniform 0 int4 -1 0 0 0 +todo draw quad +todo probe all rgba (-1, -1, -1, -1) +uniform 0 int4 0 0 0 0 +todo draw quad +todo probe all rgba (0, 0, 0, 0) + +[pixel shader notimpl] +uniform int4 f; + +float4 main() : sv_target +{ + return sign(f); +} + +[test] +uniform 0 int4 1 2 3 4 +todo draw quad +todo probe all rgba (1, 1, 1, 1) + +[pixel shader notimpl] +uniform int2x2 f; + +float4 main() : sv_target +{ + return sign(f); +} + +[test] +uniform 0 int4 1 2 0 0 +uniform 4 int4 3 4 0 0 +todo draw quad +todo probe all rgba (1, 1, 1, 1)