Antonio Maiorano | 268d7b8 | 2022-06-24 22:28:23 +0000 | [diff] [blame] | 1 | #version 310 es |
| 2 | |
| 3 | struct S_atomic { |
| 4 | int x; |
| 5 | uint a; |
| 6 | uint b; |
| 7 | }; |
| 8 | |
| 9 | struct S { |
| 10 | int x; |
| 11 | uint a; |
| 12 | uint b; |
| 13 | }; |
| 14 | |
| 15 | uint local_invocation_index_1 = 0u; |
| 16 | shared S_atomic wg; |
| 17 | void compute_main_inner(uint local_invocation_index) { |
| 18 | wg.x = 0; |
| 19 | atomicExchange(wg.a, 0u); |
| 20 | atomicExchange(wg.b, 0u); |
| 21 | barrier(); |
| 22 | atomicExchange(wg.a, 1u); |
| 23 | atomicExchange(wg.b, 2u); |
| 24 | return; |
| 25 | } |
| 26 | |
| 27 | void compute_main_1() { |
Antonio Maiorano | e14a27b | 2022-09-19 14:05:21 +0000 | [diff] [blame] | 28 | uint x_39 = local_invocation_index_1; |
| 29 | compute_main_inner(x_39); |
Antonio Maiorano | 268d7b8 | 2022-06-24 22:28:23 +0000 | [diff] [blame] | 30 | return; |
| 31 | } |
| 32 | |
| 33 | void compute_main(uint local_invocation_index_1_param) { |
| 34 | { |
| 35 | wg.x = 0; |
| 36 | atomicExchange(wg.a, 0u); |
| 37 | atomicExchange(wg.b, 0u); |
| 38 | } |
| 39 | barrier(); |
| 40 | local_invocation_index_1 = local_invocation_index_1_param; |
| 41 | compute_main_1(); |
| 42 | } |
| 43 | |
| 44 | layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; |
| 45 | void main() { |
| 46 | compute_main(gl_LocalInvocationIndex); |
| 47 | return; |
| 48 | } |