| #include <metal_stdlib> | |
| using namespace metal; | |
| typedef float2 __attribute__((__may_alias__)) tint_aliased_vec2_f32; | |
| struct tint_module_vars_struct { | |
| threadgroup array<uchar, 64>* v; | |
| }; | |
| struct tint_symbol_1 { | |
| array<uchar, 64> tint_symbol; | |
| }; | |
| void foo(threadgroup array<uchar, 64>* const p) { | |
| threadgroup tint_aliased_vec2_f32* const v_1 = reinterpret_cast<threadgroup float2*>(reinterpret_cast<threadgroup char*>(p) + 0u); | |
| threadgroup tint_aliased_vec2_f32* const p2 = v_1; | |
| (*p2).x = 1.0f; | |
| } | |
| void main_inner(uint tint_local_index, tint_module_vars_struct tint_module_vars) { | |
| { | |
| uint idx = tint_local_index; | |
| while(true) { | |
| uint const v_2 = idx; | |
| if ((v_2 >= 64u)) { | |
| break; | |
| } | |
| (*tint_module_vars.v)[v_2] = 0u; | |
| { | |
| idx = (idx + 1u); | |
| } | |
| } | |
| } | |
| (threadgroup_barrier(mem_flags::mem_threadgroup)); | |
| (foo(tint_module_vars.v)); | |
| } | |
| [[max_total_threads_per_threadgroup(1)]] | |
| kernel void v_3(uint tint_local_index [[thread_index_in_threadgroup]], threadgroup tint_symbol_1* v_4 [[threadgroup(0)]]) { | |
| tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.v=(&(*v_4).tint_symbol)}; | |
| (main_inner(tint_local_index, tint_module_vars)); | |
| } |