| #include <metal_stdlib> |
| using namespace metal; |
| |
| struct tint_module_vars_struct { |
| thread float* p; |
| threadgroup float* w; |
| }; |
| |
| struct tint_symbol_2 { |
| float tint_symbol_1; |
| }; |
| |
| void tint_symbol_inner(uint tint_local_index, tint_module_vars_struct tint_module_vars) { |
| if ((tint_local_index == 0u)) { |
| (*tint_module_vars.w) = 0.0f; |
| } |
| threadgroup_barrier(mem_flags::mem_threadgroup); |
| thread float* const p_ptr = tint_module_vars.p; |
| threadgroup float* const w_ptr = tint_module_vars.w; |
| float const x = ((*p_ptr) + (*w_ptr)); |
| (*p_ptr) = x; |
| } |
| |
| kernel void tint_symbol(uint tint_local_index [[thread_index_in_threadgroup]], threadgroup tint_symbol_2* v [[threadgroup(0)]]) { |
| thread float p = 0.0f; |
| tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.p=(&p), .w=(&(*v).tint_symbol_1)}; |
| tint_symbol_inner(tint_local_index, tint_module_vars); |
| } |