From: Giovanni Mascellani gmascellani@codeweavers.com
--- Makefile.am | 1 + tests/hlsl-length.shader_test | 80 +++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 tests/hlsl-length.shader_test
diff --git a/Makefile.am b/Makefile.am index cc06a839..ba69c4f3 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); +}