Signed-off-by: Francisco Casas fcasas@codeweavers.com --- Makefile.am | 2 + ...lsl-initializer-invalid-n-args.shader_test | 95 +++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 tests/hlsl-initializer-invalid-n-args.shader_test
diff --git a/Makefile.am b/Makefile.am index 4a079c11..cdb59a85 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-invalid-n-args.shader_test \ tests/hlsl-initializer-local-array.shader_test \ tests/hlsl-initializer-static-array.shader_test \ tests/hlsl-initializer-struct.shader_test \ @@ -292,6 +293,7 @@ XFAIL_TESTS = \ tests/cast-to-uint.shader_test \ tests/conditional.shader_test \ tests/hlsl-array-dimension.shader_test \ + tests/hlsl-initializer-invalid-n-args.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-n-args.shader_test b/tests/hlsl-initializer-invalid-n-args.shader_test new file mode 100644 index 00000000..bde6024f --- /dev/null +++ b/tests/hlsl-initializer-invalid-n-args.shader_test @@ -0,0 +1,95 @@ +[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; +}