Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- Makefile.am | 2 + tests/hlsl-numeric-types.shader_test | 102 +++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 tests/hlsl-numeric-types.shader_test
diff --git a/Makefile.am b/Makefile.am index d6e14cf1..3e083b0a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -71,6 +71,7 @@ vkd3d_shader_tests = \ tests/hlsl-majority-pragma.shader_test \ tests/hlsl-majority-typedef.shader_test \ tests/hlsl-nested-arrays.shader_test \ + tests/hlsl-numeric-types.shader_test \ tests/hlsl-return-implicit-conversion.shader_test \ tests/hlsl-return-void.shader_test \ tests/hlsl-shape.shader_test \ @@ -294,6 +295,7 @@ XFAIL_TESTS = \ tests/hlsl-majority-pragma.shader_test \ tests/hlsl-majority-typedef.shader_test \ tests/hlsl-nested-arrays.shader_test \ + tests/hlsl-numeric-types.shader_test \ tests/hlsl-return-implicit-conversion.shader_test \ tests/hlsl-return-void.shader_test \ tests/hlsl-shape.shader_test \ diff --git a/tests/hlsl-numeric-types.shader_test b/tests/hlsl-numeric-types.shader_test new file mode 100644 index 00000000..7504f95a --- /dev/null +++ b/tests/hlsl-numeric-types.shader_test @@ -0,0 +1,102 @@ +[pixel shader] +vector main() : sv_target +{ + float4 ret = vector(1.0, 2.0, 3.0, 4.0); + return ret; +} + +[test] +draw quad +probe all rgba (1.0, 2.0, 3.0, 4.0) + +[pixel shader] +float4 main() : sv_target +{ + vector<float, 4> ret = float4(1.0, 2.0, 3.0, 4.0); + return ret; +} + +[test] +draw quad +probe all rgba (1.0, 2.0, 3.0, 4.0) + +[pixel shader] +float4 main() : sv_target +{ + vector<float, 3> ret = vector<float, 3>(1.0, 2.0, 3.0); + return vector(ret, 0.0); +} + +[test] +draw quad +probe all rgba (1.0, 2.0, 3.0, 0.0) + +[pixel shader fail] +vector main() : sv_target +{ + vector ret = vector(1.0, 2.0, 3.0); + return ret; +} + +[pixel shader fail] +vector main() : sv_target +{ + vector<float> ret = vector(1.0, 2.0, 3.0, 4.0); + return ret; +} + +[pixel shader] +float4 main() : sv_target +{ + matrix m = matrix<float, 4, 4>(1.0, 2.0, 3.0, 4.0, + 5.0, 6.0, 7.0, 8.0, + 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0); + return m[1]; +} + +[test] +draw quad +probe all rgba (5.0, 6.0, 7.0, 8.0) + +[pixel shader] +float4 main() : sv_target +{ + matrix<float, 2, 3> m = float2x3(1.0, 2.0, 3.0, + 5.0, 6.0, 7.0); + return float4(m[1], 0.0); +} + +[test] +draw quad +probe all rgba (5.0, 6.0, 7.0, 0.0) + +[pixel shader fail] +float4 main() : sv_target +{ + matrix m = matrix<float>(1.0, 2.0, 3.0, 4.0, + 5.0, 6.0, 7.0, 8.0, + 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0); + return m[1]; +} + +[pixel shader fail] +float4 main() : sv_target +{ + matrix m = matrix<float, 4>(1.0, 2.0, 3.0, 4.0, + 5.0, 6.0, 7.0, 8.0, + 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0, 16.0); + return m[1]; +} + +[pixel shader fail] +float4 main() : sv_target +{ + matrix m = matrix(1.0, 2.0, 3.0, 4.0, + 5.0, 6.0, 7.0, 8.0, + 9.0, 10.0, 11.0, 12.0, + 13.0, 14.0, 15.0); + return m[1]; +}