Signed-off-by: Francisco Casas fcasas@codeweavers.com ---
v3: Replaced double2 with int2 so that tests are compatible with ps_4_0.
Signed-off-by: Francisco Casas fcasas@codeweavers.com --- Makefile.am | 2 + tests/hlsl-initializer-struct.shader_test | 77 +++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 tests/hlsl-initializer-struct.shader_test
diff --git a/Makefile.am b/Makefile.am index 3545d74b..051053cd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70,6 +70,7 @@ vkd3d_shader_tests = \ tests/hlsl-function-overload.shader_test \ tests/hlsl-initializer-local-array.shader_test \ tests/hlsl-initializer-static-array.shader_test \ + tests/hlsl-initializer-struct.shader_test \ tests/hlsl-intrinsic-override.shader_test \ tests/hlsl-invalid.shader_test \ tests/hlsl-majority-pragma.shader_test \ @@ -293,6 +294,7 @@ XFAIL_TESTS = \ tests/hlsl-array-dimension.shader_test \ tests/hlsl-initializer-local-array.shader_test \ tests/hlsl-initializer-static-array.shader_test \ + tests/hlsl-initializer-struct.shader_test \ tests/hlsl-bool-cast.shader_test \ tests/hlsl-duplicate-modifiers.shader_test \ tests/hlsl-for.shader_test \ diff --git a/tests/hlsl-initializer-struct.shader_test b/tests/hlsl-initializer-struct.shader_test new file mode 100644 index 00000000..7efb4bb4 --- /dev/null +++ b/tests/hlsl-initializer-struct.shader_test @@ -0,0 +1,77 @@ +[pixel shader] +struct stu { + int3 aaa; + float3 bbb; + int2 ccc; + float4 ddd; + int eee; +}; + +float4 main() : sv_target +{ + struct stu val = { + 11, 12, 13, + 21, 22, 23, + 31, 32, + 41, 42, 43, 44, + 51 + }; + return val.ddd; +} + +[test] +draw quad +probe all rgba (41, 42, 43, 44) + + +[pixel shader] +struct stu { + int3 aaa; + float3 bbb[2]; + int2 ccc; + float4 ddd[3][2]; + int eee; +}; + +float4 main() : sv_target +{ + struct stu val = { + 11, 12, 13, + 211, 212, 213, 221, 222, 223, + 31, 32, + 4111, 4112, 4113, 4114, 4121, 4122, 4123, 4124, + 4211, 4212, 4213, 4214, 4221, 4222, 4223, 4224, + 4311, 4312, 4313, 4314, 4321, 4322, 4323, 4324, + 51 + }; + return val.ddd[2][0]; +} + +[test] +draw quad +probe all rgba (4311, 4312, 4313, 4314) + + +[pixel shader] +struct stu { + int3 aaa; + struct { + float4 foo; + int2 bar; + } bbb[3]; +}; + +float4 main() : sv_target +{ + struct stu val = { + 1, 2, 3, + 11, 12, 13, 14, 15, 16, + 21, 22, 23, 24, 25, 26, + 31, 32, 33, 34, 35, 36 + }; + return val.bbb[1].foo; +} + +[test] +draw quad +probe all rgba (21, 22, 23, 24)
To who may concern (probably Alex):
I just realized I did something silly with the naming of the patches:
1) I marked the first batch of these 8 test patches "v3", because they superseeded test patches that were on the "v2" of the initializers batch. 2) I forgot that, so I uploaded the next version of these 8 test patches as "v2". That version was O.K. except for 1 patch: "tests: Test struct initializers." 3) So I uploaded this patch as "[PATCH vkd3d v3 2/8] tests: Test struct initializers." but it shall not be confused with the patch of the same name from 1).
I am sorry for the possible confusion :( I will try to be more careful.
January 20, 2022 6:07 PM, "Francisco Casas" fcasas@codeweavers.com wrote:
Signed-off-by: Francisco Casas fcasas@codeweavers.com
v3: Replaced double2 with int2 so that tests are compatible with ps_4_0.
Signed-off-by: Francisco Casas fcasas@codeweavers.com
Makefile.am | 2 + tests/hlsl-initializer-struct.shader_test | 77 +++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 tests/hlsl-initializer-struct.shader_test
diff --git a/Makefile.am b/Makefile.am index 3545d74b..051053cd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70,6 +70,7 @@ vkd3d_shader_tests = \ tests/hlsl-function-overload.shader_test \ tests/hlsl-initializer-local-array.shader_test \ tests/hlsl-initializer-static-array.shader_test \
- tests/hlsl-initializer-struct.shader_test \
tests/hlsl-intrinsic-override.shader_test \ tests/hlsl-invalid.shader_test \ tests/hlsl-majority-pragma.shader_test \ @@ -293,6 +294,7 @@ XFAIL_TESTS = \ tests/hlsl-array-dimension.shader_test \ tests/hlsl-initializer-local-array.shader_test \ tests/hlsl-initializer-static-array.shader_test \
- tests/hlsl-initializer-struct.shader_test \
tests/hlsl-bool-cast.shader_test \ tests/hlsl-duplicate-modifiers.shader_test \ tests/hlsl-for.shader_test \ diff --git a/tests/hlsl-initializer-struct.shader_test b/tests/hlsl-initializer-struct.shader_test new file mode 100644 index 00000000..7efb4bb4 --- /dev/null +++ b/tests/hlsl-initializer-struct.shader_test @@ -0,0 +1,77 @@ +[pixel shader] +struct stu {
- int3 aaa;
- float3 bbb;
- int2 ccc;
- float4 ddd;
- int eee;
+};
+float4 main() : sv_target +{
- struct stu val = {
- 11, 12, 13,
- 21, 22, 23,
- 31, 32,
- 41, 42, 43, 44,
- 51
- };
- return val.ddd;
+}
+[test] +draw quad +probe all rgba (41, 42, 43, 44)
+[pixel shader] +struct stu {
- int3 aaa;
- float3 bbb[2];
- int2 ccc;
- float4 ddd[3][2];
- int eee;
+};
+float4 main() : sv_target +{
- struct stu val = {
- 11, 12, 13,
- 211, 212, 213, 221, 222, 223,
- 31, 32,
- 4111, 4112, 4113, 4114, 4121, 4122, 4123, 4124,
- 4211, 4212, 4213, 4214, 4221, 4222, 4223, 4224,
- 4311, 4312, 4313, 4314, 4321, 4322, 4323, 4324,
- 51
- };
- return val.ddd[2][0];
+}
+[test] +draw quad +probe all rgba (4311, 4312, 4313, 4314)
+[pixel shader] +struct stu {
- int3 aaa;
- struct {
- float4 foo;
- int2 bar;
- } bbb[3];
+};
+float4 main() : sv_target +{
- struct stu val = {
- 1, 2, 3,
- 11, 12, 13, 14, 15, 16,
- 21, 22, 23, 24, 25, 26,
- 31, 32, 33, 34, 35, 36
- };
- return val.bbb[1].foo;
+}
+[test] +draw quad
+probe all rgba (21, 22, 23, 24)
2.25.1
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com
Il 20/01/22 22:06, Francisco Casas ha scritto:
Signed-off-by: Francisco Casas fcasas@codeweavers.com
v3: Replaced double2 with int2 so that tests are compatible with ps_4_0.
Signed-off-by: Francisco Casas fcasas@codeweavers.com
Makefile.am | 2 + tests/hlsl-initializer-struct.shader_test | 77 +++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 tests/hlsl-initializer-struct.shader_test
diff --git a/Makefile.am b/Makefile.am index 3545d74b..051053cd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70,6 +70,7 @@ vkd3d_shader_tests = \ tests/hlsl-function-overload.shader_test \ tests/hlsl-initializer-local-array.shader_test \ tests/hlsl-initializer-static-array.shader_test \
- tests/hlsl-initializer-struct.shader_test \ tests/hlsl-intrinsic-override.shader_test \ tests/hlsl-invalid.shader_test \ tests/hlsl-majority-pragma.shader_test \
@@ -293,6 +294,7 @@ XFAIL_TESTS = \ tests/hlsl-array-dimension.shader_test \ tests/hlsl-initializer-local-array.shader_test \ tests/hlsl-initializer-static-array.shader_test \
- tests/hlsl-initializer-struct.shader_test \ tests/hlsl-bool-cast.shader_test \ tests/hlsl-duplicate-modifiers.shader_test \ tests/hlsl-for.shader_test \
diff --git a/tests/hlsl-initializer-struct.shader_test b/tests/hlsl-initializer-struct.shader_test new file mode 100644 index 00000000..7efb4bb4 --- /dev/null +++ b/tests/hlsl-initializer-struct.shader_test @@ -0,0 +1,77 @@ +[pixel shader] +struct stu {
- int3 aaa;
- float3 bbb;
- int2 ccc;
- float4 ddd;
- int eee;
+};
+float4 main() : sv_target +{
- struct stu val = {
11, 12, 13,
21, 22, 23,
31, 32,
41, 42, 43, 44,
51
- };
- return val.ddd;
+}
+[test] +draw quad +probe all rgba (41, 42, 43, 44)
+[pixel shader] +struct stu {
- int3 aaa;
- float3 bbb[2];
- int2 ccc;
- float4 ddd[3][2];
- int eee;
+};
+float4 main() : sv_target +{
- struct stu val = {
11, 12, 13,
211, 212, 213, 221, 222, 223,
31, 32,
4111, 4112, 4113, 4114, 4121, 4122, 4123, 4124,
4211, 4212, 4213, 4214, 4221, 4222, 4223, 4224,
4311, 4312, 4313, 4314, 4321, 4322, 4323, 4324,
51
- };
- return val.ddd[2][0];
+}
+[test] +draw quad +probe all rgba (4311, 4312, 4313, 4314)
+[pixel shader] +struct stu {
- int3 aaa;
- struct {
float4 foo;
int2 bar;
- } bbb[3];
+};
+float4 main() : sv_target +{
- struct stu val = {
1, 2, 3,
11, 12, 13, 14, 15, 16,
21, 22, 23, 24, 25, 26,
31, 32, 33, 34, 35, 36
- };
- return val.bbb[1].foo;
+}
+[test] +draw quad +probe all rgba (21, 22, 23, 24)