Signed-off-by: Francisco Casas fcasas@codeweavers.com --- Makefile.am | 2 + tests/hlsl-initializer-flatten.shader_test | 70 ++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 tests/hlsl-initializer-flatten.shader_test
diff --git a/Makefile.am b/Makefile.am index 2ffe81af..b4d4d91d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -68,6 +68,7 @@ vkd3d_shader_tests = \ tests/hlsl-duplicate-modifiers.shader_test \ tests/hlsl-for.shader_test \ tests/hlsl-function-overload.shader_test \ + tests/hlsl-initializer-flatten.shader_test \ tests/hlsl-initializer-nested.shader_test \ tests/hlsl-initializer-invalid-n-args.shader_test \ tests/hlsl-initializer-local-array.shader_test \ @@ -297,6 +298,7 @@ XFAIL_TESTS = \ tests/cast-to-int.shader_test \ tests/cast-to-uint.shader_test \ tests/hlsl-array-dimension.shader_test \ + tests/hlsl-initializer-flatten.shader_test \ tests/hlsl-initializer-nested.shader_test \ tests/hlsl-initializer-invalid-n-args.shader_test \ tests/hlsl-initializer-local-array.shader_test \ diff --git a/tests/hlsl-initializer-flatten.shader_test b/tests/hlsl-initializer-flatten.shader_test new file mode 100644 index 00000000..4fd71da7 --- /dev/null +++ b/tests/hlsl-initializer-flatten.shader_test @@ -0,0 +1,70 @@ +[pixel shader] +float4 main() : sv_target +{ + float4 aa = {1, float2(2, 3), 4}; + return aa; +} + +[test] +draw quad +probe all rgba (1, 2, 3, 4) + + +[pixel shader] +struct stu { + int3 aa; + float4 bb; +}; + +float4 main() : sv_target +{ + struct stu foo = {1, 2, float2(3, 4), int3(5, 6, 7)}; + return foo.bb; +} + +[test] +draw quad +probe all rgba (4, 5, 6, 7) + + +[pixel shader] +float4 main() : sv_target +{ + int4 aa = {10, 20, 30, 40}; + float4 foo[3] = {1, aa, aa, 2, 3, 4}; + return foo[1]; +} + +[test] +draw quad +probe all rgba (40, 10, 20, 30) + + +[pixel shader] +struct stu { + float aa; + int bb; +}; + +float4 main() : sv_target +{ + struct stu foo = {2.0, 3}; + float4 f = {1.0, foo, 4.0}; + return f; +} + +[test] +draw quad +probe all rgba (1.0, 2.0, 3.0, 4.0) + + +[pixel shader] +float4 main() : sv_target +{ + int arr[3] = {2, 3, 4}; + float4 f = {1.0, arr}; + return f; +} +[test] +draw quad +probe all rgba (1.0, 2.0, 3.0, 4.0)
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com
Il 20/01/22 15:10, Francisco Casas ha scritto:
Signed-off-by: Francisco Casas fcasas@codeweavers.com
Makefile.am | 2 + tests/hlsl-initializer-flatten.shader_test | 70 ++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 tests/hlsl-initializer-flatten.shader_test
diff --git a/Makefile.am b/Makefile.am index 2ffe81af..b4d4d91d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -68,6 +68,7 @@ vkd3d_shader_tests = \ tests/hlsl-duplicate-modifiers.shader_test \ tests/hlsl-for.shader_test \ tests/hlsl-function-overload.shader_test \
- tests/hlsl-initializer-flatten.shader_test \ tests/hlsl-initializer-nested.shader_test \ tests/hlsl-initializer-invalid-n-args.shader_test \ tests/hlsl-initializer-local-array.shader_test \
@@ -297,6 +298,7 @@ XFAIL_TESTS = \ tests/cast-to-int.shader_test \ tests/cast-to-uint.shader_test \ tests/hlsl-array-dimension.shader_test \
- tests/hlsl-initializer-flatten.shader_test \ tests/hlsl-initializer-nested.shader_test \ tests/hlsl-initializer-invalid-n-args.shader_test \ tests/hlsl-initializer-local-array.shader_test \
diff --git a/tests/hlsl-initializer-flatten.shader_test b/tests/hlsl-initializer-flatten.shader_test new file mode 100644 index 00000000..4fd71da7 --- /dev/null +++ b/tests/hlsl-initializer-flatten.shader_test @@ -0,0 +1,70 @@ +[pixel shader] +float4 main() : sv_target +{
- float4 aa = {1, float2(2, 3), 4};
- return aa;
+}
+[test] +draw quad +probe all rgba (1, 2, 3, 4)
+[pixel shader] +struct stu {
- int3 aa;
- float4 bb;
+};
+float4 main() : sv_target +{
- struct stu foo = {1, 2, float2(3, 4), int3(5, 6, 7)};
- return foo.bb;
+}
+[test] +draw quad +probe all rgba (4, 5, 6, 7)
+[pixel shader] +float4 main() : sv_target +{
- int4 aa = {10, 20, 30, 40};
- float4 foo[3] = {1, aa, aa, 2, 3, 4};
- return foo[1];
+}
+[test] +draw quad +probe all rgba (40, 10, 20, 30)
+[pixel shader] +struct stu {
- float aa;
- int bb;
+};
+float4 main() : sv_target +{
- struct stu foo = {2.0, 3};
- float4 f = {1.0, foo, 4.0};
- return f;
+}
+[test] +draw quad +probe all rgba (1.0, 2.0, 3.0, 4.0)
+[pixel shader] +float4 main() : sv_target +{
- int arr[3] = {2, 3, 4};
- float4 f = {1.0, arr};
- return f;
+} +[test] +draw quad +probe all rgba (1.0, 2.0, 3.0, 4.0)