blob: 06d87e7155bffa2da2a7bd0e38de8f8e03dc22ee [file] [log] [blame]
dan sinclair8f1d2762024-07-31 02:35:40 +00001struct S_atomic {
2 int x;
3 uint a;
4 uint y;
5};
dan sinclair69313792024-06-13 20:35:21 +00006
dan sinclair8f1d2762024-07-31 02:35:40 +00007struct compute_main_inputs {
8 uint local_invocation_index_1_param : SV_GroupIndex;
9};
10
11
12static uint local_invocation_index_1 = 0u;
13groupshared S_atomic wg;
14void compute_main_inner(uint local_invocation_index_2) {
Antonio Maioranod032c622024-09-19 18:20:54 +000015 wg.x = int(0);
dan sinclair8f1d2762024-07-31 02:35:40 +000016 uint v = 0u;
17 InterlockedExchange(wg.a, 0u, v);
18 wg.y = 0u;
19 GroupMemoryBarrierWithGroupSync();
20 uint v_1 = 0u;
21 InterlockedExchange(wg.a, 1u, v_1);
22}
23
24void compute_main_1() {
25 uint x_35 = local_invocation_index_1;
26 compute_main_inner(x_35);
27}
28
29void compute_main_inner_1(uint local_invocation_index_1_param) {
Peter McNeeley1d274352024-11-21 19:45:21 +000030 if ((local_invocation_index_1_param < 1u)) {
Antonio Maioranod032c622024-09-19 18:20:54 +000031 wg.x = int(0);
dan sinclair8f1d2762024-07-31 02:35:40 +000032 uint v_2 = 0u;
33 InterlockedExchange(wg.a, 0u, v_2);
34 wg.y = 0u;
35 }
36 GroupMemoryBarrierWithGroupSync();
37 local_invocation_index_1 = local_invocation_index_1_param;
38 compute_main_1();
39}
40
41[numthreads(1, 1, 1)]
42void compute_main(compute_main_inputs inputs) {
43 compute_main_inner_1(inputs.local_invocation_index_1_param);
44}
45