blob: 8cea45d2680172fe40a4fa99e1cca0ad6aae4ff9 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct tint_module_vars_struct {
threadgroup atomic_uint* arg_0;
device uint* prevent_dce;
};
struct tint_symbol_1 {
atomic_uint tint_symbol;
};
uint atomicAnd_34edd3(tint_module_vars_struct tint_module_vars) {
uint res = atomic_fetch_and_explicit(tint_module_vars.arg_0, 1u, memory_order_relaxed);
return res;
}
void compute_main_inner(uint tint_local_index, tint_module_vars_struct tint_module_vars) {
if ((tint_local_index == 0u)) {
atomic_store_explicit(tint_module_vars.arg_0, 0u, memory_order_relaxed);
}
threadgroup_barrier(mem_flags::mem_threadgroup);
(*tint_module_vars.prevent_dce) = atomicAnd_34edd3(tint_module_vars);
}
kernel void compute_main(uint tint_local_index [[thread_index_in_threadgroup]], threadgroup tint_symbol_1* v [[threadgroup(0)]], device uint* prevent_dce [[buffer(0)]]) {
tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=(&(*v).tint_symbol), .prevent_dce=prevent_dce};
compute_main_inner(tint_local_index, tint_module_vars);
}