blob: 5da924a115d19bcff0385080cdb44c886b0fc8a5 [file] [log] [blame]
Stephen White671d9702022-01-21 18:40:18 +00001#version 310 es
Stephen White671d9702022-01-21 18:40:18 +00002
Ben Clayton9dc42ad2024-02-05 18:01:33 +00003shared ivec4 src_workgroup[4];
4void tint_zero_workgroup_memory(uint local_idx) {
5 {
6 for(uint idx = local_idx; (idx < 4u); idx = (idx + 1u)) {
7 uint i = idx;
8 src_workgroup[i] = ivec4(0);
9 }
10 }
11 barrier();
12}
13
Stephen White671d9702022-01-21 18:40:18 +000014struct S {
15 ivec4 arr[4];
16};
17
18ivec4 src_private[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
Stephen White05d8b022022-09-13 19:48:51 +000019layout(binding = 0, std140) uniform src_uniform_block_ubo {
Stephen White863d9ed2022-09-02 19:19:10 +000020 S inner;
Stephen White671d9702022-01-21 18:40:18 +000021} src_uniform;
Stephen Whitee2f35ba2022-01-26 16:48:55 +000022
Stephen White863d9ed2022-09-02 19:19:10 +000023layout(binding = 1, std430) buffer src_uniform_block_ssbo {
24 S inner;
Stephen White671d9702022-01-21 18:40:18 +000025} src_storage;
Stephen White863d9ed2022-09-02 19:19:10 +000026
Stephen White671d9702022-01-21 18:40:18 +000027ivec4 dst[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
28int dst_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)));
Stephen White671d9702022-01-21 18:40:18 +000029ivec4[4] ret_arr() {
dan sinclaira01fd242023-12-05 20:23:42 +000030 ivec4 tint_symbol_2[4] = ivec4[4](ivec4(0), ivec4(0), ivec4(0), ivec4(0));
31 return tint_symbol_2;
Stephen White671d9702022-01-21 18:40:18 +000032}
33
34S ret_struct_arr() {
dan sinclaira01fd242023-12-05 20:23:42 +000035 S tint_symbol_3 = S(ivec4[4](ivec4(0), ivec4(0), ivec4(0), ivec4(0)));
36 return tint_symbol_3;
Stephen White671d9702022-01-21 18:40:18 +000037}
38
39void foo(ivec4 src_param[4]) {
40 ivec4 src_function[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
dan sinclaira01fd242023-12-05 20:23:42 +000041 ivec4 tint_symbol_4[4] = ivec4[4](ivec4(1), ivec4(2), ivec4(3), ivec4(3));
42 dst = tint_symbol_4;
Stephen White671d9702022-01-21 18:40:18 +000043 dst = src_param;
44 dst = ret_arr();
Ben Clayton19576e92022-06-28 12:44:16 +000045 ivec4 src_let[4] = ivec4[4](ivec4(0), ivec4(0), ivec4(0), ivec4(0));
Stephen White671d9702022-01-21 18:40:18 +000046 dst = src_let;
47 dst = src_function;
48 dst = src_private;
49 dst = src_workgroup;
dan sinclaira01fd242023-12-05 20:23:42 +000050 S tint_symbol_1 = ret_struct_arr();
51 dst = tint_symbol_1.arr;
Stephen White863d9ed2022-09-02 19:19:10 +000052 dst = src_uniform.inner.arr;
53 dst = src_storage.inner.arr;
Stephen White671d9702022-01-21 18:40:18 +000054 int src_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)));
55 dst_nested = src_nested;
56}
Stephen Whitee2f35ba2022-01-26 16:48:55 +000057
dan sinclaira01fd242023-12-05 20:23:42 +000058void tint_symbol(uint local_invocation_index) {
Ben Clayton9dc42ad2024-02-05 18:01:33 +000059 tint_zero_workgroup_memory(local_invocation_index);
dan sinclaira01fd242023-12-05 20:23:42 +000060 ivec4 a[4] = ivec4[4](ivec4(0), ivec4(0), ivec4(0), ivec4(0));
61 foo(a);
62}
63
64layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
65void main() {
66 tint_symbol(gl_LocalInvocationIndex);
67 return;
68}