Module: vkd3d Branch: master Commit: a43242a3e6fb73090d7bb0a9cf66d55be029445e URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/a43242a3e6fb73090d7bb0a9cf66d5...
Author: Giovanni Mascellani gmascellani@codeweavers.com Date: Tue Oct 4 23:31:42 2022 +0200
tests: Test length() intrinsic.
---
Makefile.am | 1 + tests/hlsl-length.shader_test | 80 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+)
diff --git a/Makefile.am b/Makefile.am index 110b66f6..24602862 100644 --- a/Makefile.am +++ b/Makefile.am @@ -90,6 +90,7 @@ vkd3d_shader_tests = \ tests/hlsl-intrinsic-override.shader_test \ tests/hlsl-invalid.shader_test \ tests/hlsl-ldexp.shader_test \ + tests/hlsl-length.shader_test \ tests/hlsl-lerp.shader_test \ tests/hlsl-majority-pragma.shader_test \ tests/hlsl-majority-typedef.shader_test \ diff --git a/tests/hlsl-length.shader_test b/tests/hlsl-length.shader_test new file mode 100644 index 00000000..e9f7c8ae --- /dev/null +++ b/tests/hlsl-length.shader_test @@ -0,0 +1,80 @@ +[pixel shader] +uniform float4 x; + +float4 main() : SV_TARGET +{ + return length(x); +} + +[test] +uniform 0 float4 2.0 3.0 4.0 5.0 +todo draw quad +probe all rgba (7.34846926, 7.34846926, 7.34846926, 7.34846926) 1 + +[pixel shader] +uniform float3 x; + +float4 main() : SV_TARGET +{ + return length(x); +} + +[test] +uniform 0 float4 2.0 3.0 4.0 0.0 +todo draw quad +probe all rgba (5.38516474, 5.38516474, 5.38516474, 5.38516474) 1 + +[pixel shader] +uniform float2 x; + +float4 main() : SV_TARGET +{ + return length(x); +} + +[test] +uniform 0 float4 2.0 3.0 0.0 0.0 +todo draw quad +probe all rgba (3.60555124, 3.60555124, 3.60555124, 3.60555124) 1 + +[pixel shader] +uniform float1 x; + +float4 main() : SV_TARGET +{ + return length(x); +} + +[test] +uniform 0 float4 2.0 0.0 0.0 0.0 +todo draw quad +probe all rgba (2.0, 2.0, 2.0, 2.0) + +[pixel shader] +uniform float x; + +float4 main() : SV_TARGET +{ + return length(x); +} + +[test] +uniform 0 float4 2.0 0.0 0.0 0.0 +todo draw quad +probe all rgba (2.0, 2.0, 2.0, 2.0) + +[pixel shader fail] +uniform float1x3 x; + +float4 main() : SV_TARGET +{ + return length(x); +} + +[pixel shader fail] +uniform float4x1 x; + +float4 main() : SV_TARGET +{ + return length(x); +}