Antonio Maiorano | 268d7b8 | 2022-06-24 22:28:23 +0000 | [diff] [blame] | 1 | struct S0_atomic { |
| 2 | int x; |
| 3 | uint a; |
| 4 | int y; |
| 5 | int z; |
| 6 | }; |
| 7 | struct S1_atomic { |
| 8 | int x; |
| 9 | S0_atomic a; |
| 10 | int y; |
| 11 | int z; |
| 12 | }; |
| 13 | struct S2_atomic { |
| 14 | int x; |
| 15 | int y; |
| 16 | int z; |
| 17 | S1_atomic a; |
| 18 | }; |
| 19 | |
| 20 | static uint local_invocation_index_1 = 0u; |
| 21 | groupshared S2_atomic wg; |
| 22 | |
Ben Clayton | 4d3ff97 | 2023-02-21 17:33:54 +0000 | [diff] [blame] | 23 | void compute_main_inner(uint local_invocation_index_2) { |
Antonio Maiorano | 268d7b8 | 2022-06-24 22:28:23 +0000 | [diff] [blame] | 24 | wg.x = 0; |
| 25 | wg.y = 0; |
| 26 | wg.z = 0; |
| 27 | wg.a.x = 0; |
| 28 | wg.a.a.x = 0; |
| 29 | uint atomic_result = 0u; |
| 30 | InterlockedExchange(wg.a.a.a, 0u, atomic_result); |
| 31 | wg.a.a.y = 0; |
| 32 | wg.a.a.z = 0; |
| 33 | wg.a.y = 0; |
| 34 | wg.a.z = 0; |
| 35 | GroupMemoryBarrierWithGroupSync(); |
| 36 | uint atomic_result_1 = 0u; |
| 37 | InterlockedExchange(wg.a.a.a, 1u, atomic_result_1); |
| 38 | return; |
| 39 | } |
| 40 | |
| 41 | void compute_main_1() { |
Antonio Maiorano | e14a27b | 2022-09-19 14:05:21 +0000 | [diff] [blame] | 42 | const uint x_44 = local_invocation_index_1; |
| 43 | compute_main_inner(x_44); |
Antonio Maiorano | 268d7b8 | 2022-06-24 22:28:23 +0000 | [diff] [blame] | 44 | return; |
| 45 | } |
| 46 | |
| 47 | struct tint_symbol_1 { |
| 48 | uint local_invocation_index_1_param : SV_GroupIndex; |
| 49 | }; |
| 50 | |
| 51 | void compute_main_inner_1(uint local_invocation_index_1_param) { |
| 52 | { |
| 53 | wg.x = 0; |
| 54 | wg.y = 0; |
| 55 | wg.z = 0; |
| 56 | wg.a.x = 0; |
| 57 | wg.a.a.x = 0; |
| 58 | uint atomic_result_2 = 0u; |
| 59 | InterlockedExchange(wg.a.a.a, 0u, atomic_result_2); |
| 60 | wg.a.a.y = 0; |
| 61 | wg.a.a.z = 0; |
| 62 | wg.a.y = 0; |
| 63 | wg.a.z = 0; |
| 64 | } |
| 65 | GroupMemoryBarrierWithGroupSync(); |
| 66 | local_invocation_index_1 = local_invocation_index_1_param; |
| 67 | compute_main_1(); |
| 68 | } |
| 69 | |
| 70 | [numthreads(1, 1, 1)] |
| 71 | void compute_main(tint_symbol_1 tint_symbol) { |
| 72 | compute_main_inner_1(tint_symbol.local_invocation_index_1_param); |
| 73 | return; |
| 74 | } |