Antonio Maiorano | 268d7b8 | 2022-06-24 22:28:23 +0000 | [diff] [blame] | 1 | #version 310 es |
| 2 | |
| 3 | struct S0_atomic { |
| 4 | int x; |
| 5 | uint a; |
| 6 | int y; |
| 7 | int z; |
| 8 | }; |
| 9 | |
| 10 | struct S0 { |
| 11 | int x; |
| 12 | uint a; |
| 13 | int y; |
| 14 | int z; |
| 15 | }; |
| 16 | |
| 17 | struct S1_atomic { |
| 18 | int x; |
| 19 | S0_atomic a; |
| 20 | int y; |
| 21 | int z; |
| 22 | }; |
| 23 | |
| 24 | struct S1 { |
| 25 | int x; |
| 26 | S0 a; |
| 27 | int y; |
| 28 | int z; |
| 29 | }; |
| 30 | |
| 31 | struct S2_atomic { |
| 32 | int x; |
| 33 | int y; |
| 34 | int z; |
| 35 | S1_atomic a; |
| 36 | }; |
| 37 | |
| 38 | struct S2 { |
| 39 | int x; |
| 40 | int y; |
| 41 | int z; |
| 42 | S1 a; |
| 43 | }; |
| 44 | |
| 45 | uint local_invocation_index_1 = 0u; |
| 46 | shared S2_atomic wg; |
Ben Clayton | 4d3ff97 | 2023-02-21 17:33:54 +0000 | [diff] [blame] | 47 | void compute_main_inner(uint local_invocation_index_2) { |
Antonio Maiorano | 268d7b8 | 2022-06-24 22:28:23 +0000 | [diff] [blame] | 48 | wg.x = 0; |
| 49 | wg.y = 0; |
| 50 | wg.z = 0; |
| 51 | wg.a.x = 0; |
| 52 | wg.a.a.x = 0; |
| 53 | atomicExchange(wg.a.a.a, 0u); |
| 54 | wg.a.a.y = 0; |
| 55 | wg.a.a.z = 0; |
| 56 | wg.a.y = 0; |
| 57 | wg.a.z = 0; |
| 58 | barrier(); |
| 59 | atomicExchange(wg.a.a.a, 1u); |
| 60 | return; |
| 61 | } |
| 62 | |
| 63 | void compute_main_1() { |
Antonio Maiorano | e14a27b | 2022-09-19 14:05:21 +0000 | [diff] [blame] | 64 | uint x_44 = local_invocation_index_1; |
| 65 | compute_main_inner(x_44); |
Antonio Maiorano | 268d7b8 | 2022-06-24 22:28:23 +0000 | [diff] [blame] | 66 | return; |
| 67 | } |
| 68 | |
| 69 | void compute_main(uint local_invocation_index_1_param) { |
| 70 | { |
| 71 | wg.x = 0; |
| 72 | wg.y = 0; |
| 73 | wg.z = 0; |
| 74 | wg.a.x = 0; |
| 75 | wg.a.a.x = 0; |
| 76 | atomicExchange(wg.a.a.a, 0u); |
| 77 | wg.a.a.y = 0; |
| 78 | wg.a.a.z = 0; |
| 79 | wg.a.y = 0; |
| 80 | wg.a.z = 0; |
| 81 | } |
| 82 | barrier(); |
| 83 | local_invocation_index_1 = local_invocation_index_1_param; |
| 84 | compute_main_1(); |
| 85 | } |
| 86 | |
| 87 | layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; |
| 88 | void main() { |
| 89 | compute_main(gl_LocalInvocationIndex); |
| 90 | return; |
| 91 | } |