Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- Makefile.am | 2 + tests/hlsl-shape.shader_test | 355 +++++++++++++++++++++++++++++++++++ 2 files changed, 357 insertions(+) create mode 100644 tests/hlsl-shape.shader_test
diff --git a/Makefile.am b/Makefile.am index 05d9f00c..5decb3ef 100644 --- a/Makefile.am +++ b/Makefile.am @@ -67,6 +67,7 @@ vkd3d_shader_tests = \ tests/hlsl-nested-arrays.shader_test \ tests/hlsl-return-implicit-conversion.shader_test \ tests/hlsl-return-void.shader_test \ + tests/hlsl-shape.shader_test \ tests/hlsl-static-initializer.shader_test \ tests/hlsl-storage-qualifiers.shader_test \ tests/hlsl-struct-assignment.shader_test \ @@ -278,6 +279,7 @@ XFAIL_TESTS = \ tests/hlsl-nested-arrays.shader_test \ tests/hlsl-return-implicit-conversion.shader_test \ tests/hlsl-return-void.shader_test \ + tests/hlsl-shape.shader_test \ tests/hlsl-static-initializer.shader_test \ tests/hlsl-storage-qualifiers.shader_test \ tests/hlsl-vector-indexing.shader_test \ diff --git a/tests/hlsl-shape.shader_test b/tests/hlsl-shape.shader_test new file mode 100644 index 00000000..b96f0fd2 --- /dev/null +++ b/tests/hlsl-shape.shader_test @@ -0,0 +1,355 @@ +[pixel shader] +float4 main() : sv_target +{ + float x = 1.0; + float y = 2.0; + return float4(x + y, 0.0, 0.0, 0.0); +} + +[test] +draw quad +probe all rgba (3.0, 0.0, 0.0, 0.0) + +[pixel shader] +float4 main() : sv_target +{ + float1 x = float1(1.0); + float2 y = float2(1.0, 2.0); + return float4(x + y, 0.0, 0.0); +} + +[test] +draw quad +probe all rgba (2.0, 3.0, 0.0, 0.0) + +[pixel shader] +float4 main() : sv_target +{ + float1 x = float1(1.0); + float4 y = float4(1.0, 2.0, 3.0, 4.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 3.0, 4.0, 5.0) + +[pixel shader] +float4 main() : sv_target +{ + float2 x = float2(1.0, 2.0); + float4 y = float4(1.0, 2.0, 3.0, 4.0); + return float4(x + y, 0.0, 0.0); +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 0.0, 0.0) + +[pixel shader] +float4 main() : sv_target +{ + float x = 1.0; + float1 y = float1(1.0); + return float4(x + y, y + x, 0.0, 0.0); +} + +[test] +draw quad +probe all rgba (2.0, 2.0, 0.0, 0.0) + +[pixel shader] +float4 main() : sv_target +{ + float x = 1.0; + float4 y = float4(1.0, 2.0, 3.0, 4.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 3.0, 4.0, 5.0) + +[pixel shader] +float4 main() : sv_target +{ + float4 x = float4(1.0, 2.0, 3.0, 4.0); + float y = 1.0; + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 3.0, 4.0, 5.0) + +[pixel shader] +float4 main() : sv_target +{ + float2x2 x = float2x2(1.0, 2.0, + 3.0, 4.0); + float2x3 y = float2x3(1.0, 2.0, 3.0, + 4.0, 5.0, 6.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 7.0, 9.0) + +[pixel shader] +float4 main() : sv_target +{ + float2x3 x = float2x3(1.0, 2.0, 3.0, + 4.0, 5.0, 6.0); + float2x2 y = float2x2(1.0, 2.0, + 3.0, 4.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 7.0, 9.0) + +[pixel shader] +float4 main() : sv_target +{ + float1x4 x = float1x4(1.0, 2.0, 3.0, 4.0); + float4x4 y = float4x4(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 x + y; +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 6.0, 8.0) + +[pixel shader] +float4 main() : sv_target +{ + float4x4 x = float4x4(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); + float1x4 y = float1x4(1.0, 2.0, 3.0, 4.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 6.0, 8.0) + +[pixel shader] +float4 main() : sv_target +{ + float4x1 x = float4x1(1.0, 2.0, 3.0, 4.0); + float4x4 y = float4x4(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 x + y; +} + +[test] +draw quad +probe all rgba (2.0, 7.0, 12.0, 17.0) + +[pixel shader] +float4 main() : sv_target +{ + float4x4 x = float4x4(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); + float4x1 y = float4x1(1.0, 2.0, 3.0, 4.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 7.0, 12.0, 17.0) + +[pixel shader] +float4 main() : sv_target +{ + float4x4 x = float4x4(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); + float2x3 y = float2x3(1.0, 2.0, 3.0, + 4.0, 5.0, 6.0); + return float4((x + y)[0], 0.0); +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 6.0, 0.0) + +[pixel shader] +float4 main() : sv_target +{ + float2x3 x = float2x3(1.0, 2.0, 3.0, + 4.0, 5.0, 6.0); + float4x4 y = float4x4(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 float4((x + y)[1], 0.0); +} + +[test] +draw quad +probe all rgba (9.0, 11.0, 13.0, 0.0) + +[pixel shader] +float4 main() : sv_target +{ + float4 x = float4(1.0, 2.0, 3.0, 4.0); + float1x4 y = float1x4(1.0, 2.0, 3.0, 4.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 6.0, 8.0) + +[pixel shader] +float4 main() : sv_target +{ + float1x4 x = float1x4(1.0, 2.0, 3.0, 4.0); + float4 y = float4(1.0, 2.0, 3.0, 4.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 6.0, 8.0) + +[pixel shader] +float4 main() : sv_target +{ + float4 x = float4(1.0, 2.0, 3.0, 4.0); + float4x1 y = float4x1(1.0, 2.0, 3.0, 4.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 6.0, 8.0) + +[pixel shader] +float4 main() : sv_target +{ + float4x1 x = float4x1(1.0, 2.0, 3.0, 4.0); + float4 y = float4(1.0, 2.0, 3.0, 4.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 6.0, 8.0) + +[pixel shader] +float4 main() : sv_target +{ + float4 x = float4(1.0, 2.0, 3.0, 4.0); + float2x2 y = float2x2(1.0, 2.0, + 3.0, 4.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 6.0, 8.0) + +[pixel shader] +float4 main() : sv_target +{ + float2x2 x = float2x2(1.0, 2.0, + 3.0, 4.0); + float4 y = float4(1.0, 2.0, 3.0, 4.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 6.0, 8.0) + +[pixel shader] +float4 main() : sv_target +{ + float1 x = float1(1.0); + float1x4 y = float1x4(1.0, 2.0, 3.0, 4.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 3.0, 4.0, 5.0) + +[pixel shader] +float4 main() : sv_target +{ + float1x4 x = float1x4(1.0, 2.0, 3.0, 4.0); + float1 y = float1(1.0); + return x + y; +} + +[test] +draw quad +probe all rgba (2.0, 3.0, 4.0, 5.0) + +[pixel shader] +float4 main() : sv_target +{ + float2 x = float2(1.0, 2.0); + float4x1 y = float4x1(1.0, 2.0, 3.0, 4.0); + return float4(x + y, 0.0, 0.0); +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 0.0, 0.0) + +[pixel shader] +float4 main() : sv_target +{ + float4x1 x = float4x1(1.0, 2.0, 3.0, 4.0); + float2 y = float2(1.0, 2.0); + return float4(x + y, 0.0, 0.0); +} + +[test] +draw quad +probe all rgba (2.0, 4.0, 0.0, 0.0) + +[pixel shader] +float4 main() : sv_target +{ + float x = 1.0; + float4x4 y = float4x4(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 (x + y)[0]; +} + +[test] +draw quad +probe all rgba (2.0, 3.0, 4.0, 5.0) + +[pixel shader] +float4 main() : sv_target +{ + float4x4 x = float4x4(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); + float y = 1.0; + return (x + y)[1]; +} + +[test] +draw quad +probe all rgba (6.0, 7.0, 8.0, 9.0)
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- Makefile.am | 2 ++ tests/hlsl-for.shader_test | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/hlsl-for.shader_test
diff --git a/Makefile.am b/Makefile.am index 5decb3ef..44e28606 100644 --- a/Makefile.am +++ b/Makefile.am @@ -60,6 +60,7 @@ vkd3d_shader_tests = \ tests/hlsl-clamp.shader_test \ tests/hlsl-comma.shader_test \ tests/hlsl-duplicate-modifiers.shader_test \ + tests/hlsl-for.shader_test \ tests/hlsl-function-overload.shader_test \ tests/hlsl-invalid.shader_test \ tests/hlsl-majority-pragma.shader_test \ @@ -273,6 +274,7 @@ XFAIL_TESTS = \ tests/hlsl-clamp.shader_test \ tests/hlsl-comma.shader_test \ tests/hlsl-duplicate-modifiers.shader_test \ + tests/hlsl-for.shader_test \ tests/hlsl-function-overload.shader_test \ tests/hlsl-majority-pragma.shader_test \ tests/hlsl-majority-typedef.shader_test \ diff --git a/tests/hlsl-for.shader_test b/tests/hlsl-for.shader_test new file mode 100644 index 00000000..b133ce99 --- /dev/null +++ b/tests/hlsl-for.shader_test @@ -0,0 +1,22 @@ +[pixel shader] +float4 main(float4 pos : SV_POSITION) : SV_TARGET +{ + int i; + float x = 0.0; + for (i = 0; i < 10; i++) + { + x += i; + if (pos.x == 1.5 && i == 5) + break; + if (pos.x == 2.5 && i >= 7) + continue; + x -= 1; + } + return float4(i, x, 0.0, 0.0); +} + +[test] +draw quad +probe rgba (0, 0) (10.0, 35.0, 0.0, 0.0) +probe rgba (1, 0) (5.0, 10.0, 0.0, 0.0) +probe rgba (2, 0) (10.0, 38.0, 0.0, 0.0)
Signed-off-by: Zebediah Figura zfigura@codeweavers.com