Francisco Casas : tests: Test invalid number of arguments on initializers.
Alexandre Julliard
julliard at winehq.org
Fri Feb 4 16:06:36 CST 2022
Module: vkd3d
Branch: master
Commit: 053f5354cc2be972a00708bb719773b1aec3329f
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=053f5354cc2be972a00708bb719773b1aec3329f
Author: Francisco Casas <fcasas at codeweavers.com>
Date: Thu Feb 3 23:44:19 2022 +0100
tests: Test invalid number of arguments on initializers.
Signed-off-by: Francisco Casas <fcasas at codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
Makefile.am | 2 +
.../hlsl-initializer-invalid-arg-count.shader_test | 107 +++++++++++++++++++++
2 files changed, 109 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 8cedf20..7358faa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,6 +68,7 @@ vkd3d_shader_tests = \
tests/hlsl-function-overload.shader_test \
tests/hlsl-gather-offset.shader_test \
tests/hlsl-gather.shader_test \
+ tests/hlsl-initializer-invalid-arg-count.shader_test \
tests/hlsl-initializer-local-array.shader_test \
tests/hlsl-initializer-static-array.shader_test \
tests/hlsl-initializer-struct.shader_test \
@@ -298,6 +299,7 @@ XFAIL_TESTS = \
tests/cast-to-int.shader_test \
tests/cast-to-uint.shader_test \
tests/hlsl-array-dimension.shader_test \
+ tests/hlsl-initializer-invalid-arg-count.shader_test \
tests/hlsl-initializer-local-array.shader_test \
tests/hlsl-initializer-static-array.shader_test \
tests/hlsl-initializer-struct.shader_test \
diff --git a/tests/hlsl-initializer-invalid-arg-count.shader_test b/tests/hlsl-initializer-invalid-arg-count.shader_test
new file mode 100644
index 0000000..4332fbe
--- /dev/null
+++ b/tests/hlsl-initializer-invalid-arg-count.shader_test
@@ -0,0 +1,107 @@
+[pixel shader]
+float4 main() : sv_target
+{
+ float4 color[2][3] =
+ {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
+ };
+ return color[1][1];
+}
+
+[test]
+draw quad
+probe all rgba (17, 18, 19, 20)
+
+
+[pixel shader fail]
+float4 main() : sv_target
+{
+ float4 color[2][3] =
+ {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
+ };
+ return color[1][1];
+}
+
+[pixel shader fail]
+float4 main() : sv_target
+{
+ float4 color[2][3] =
+ {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
+ };
+ return color[1][1];
+}
+
+
+[pixel shader]
+struct stu
+{
+ struct
+ {
+ int bar;
+ float4 foo;
+ } bbb[2];
+ int2 aaa;
+};
+
+float4 main() : sv_target
+{
+ struct stu val =
+ {
+ 11, 12, 13, 14, 25,
+ 21, 22, 23, 24, 25,
+ 31, 32,
+ };
+ return val.bbb[1].foo;
+}
+
+[test]
+draw quad
+probe all rgba (22, 23, 24, 25)
+
+
+[pixel shader fail]
+struct stu
+{
+ struct
+ {
+ int bar;
+ float4 foo;
+ } bbb[2];
+ int2 aaa;
+};
+
+float4 main() : sv_target
+{
+ struct stu val =
+ {
+ 11, 12, 13, 14, 25,
+ 21, 22, 23, 24, 25,
+ 31, 32, 33,
+ };
+ return val.bbb[1].foo;
+}
+
+
+[pixel shader fail]
+struct stu
+{
+ struct
+ {
+ int bar;
+ float4 foo;
+ } bbb[2];
+ int2 aaa;
+};
+
+float4 main() : sv_target
+{
+ struct stu val =
+ {
+ 11, 12, 13, 14, 25,
+ 21, 22, 23, 24, 25,
+ 31,
+ };
+ return val.bbb[1].foo;
+}
More information about the wine-cvs
mailing list