blob: 65c71e178518c030cf713bbad0c01d4adadc449c [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct tint_module_vars_struct {
device uint4* prevent_dce;
thread uint2* tint_subgroup_size_mask;
};
uint4 tint_subgroup_ballot(bool pred, tint_module_vars_struct tint_module_vars) {
uint2 const v = as_type<uint2>((simd_vote::vote_t)simd_ballot(pred));
return uint4((v & (*tint_module_vars.tint_subgroup_size_mask)), 0u, 0u);
}
uint4 subgroupBallot_1a8251(tint_module_vars_struct tint_module_vars) {
uint4 res = tint_subgroup_ballot(true, tint_module_vars);
return res;
}
fragment void fragment_main(uint tint_subgroup_size [[threads_per_simdgroup]], device uint4* prevent_dce [[buffer(0)]]) {
thread uint2 tint_subgroup_size_mask = 0u;
tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce, .tint_subgroup_size_mask=(&tint_subgroup_size_mask)};
uint const v_1 = select((4294967295u >> (32u - tint_subgroup_size)), 4294967295u, (tint_subgroup_size > 32u));
uint const v_2 = select(0u, (4294967295u >> (64u - tint_subgroup_size)), (tint_subgroup_size > 32u));
(*tint_module_vars.tint_subgroup_size_mask)[0u] = v_1;
(*tint_module_vars.tint_subgroup_size_mask)[1u] = v_2;
(*tint_module_vars.prevent_dce) = subgroupBallot_1a8251(tint_module_vars);
}
kernel void compute_main(uint tint_subgroup_size [[threads_per_simdgroup]], device uint4* prevent_dce [[buffer(0)]]) {
thread uint2 tint_subgroup_size_mask = 0u;
tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce, .tint_subgroup_size_mask=(&tint_subgroup_size_mask)};
uint const v_3 = select((4294967295u >> (32u - tint_subgroup_size)), 4294967295u, (tint_subgroup_size > 32u));
uint const v_4 = select(0u, (4294967295u >> (64u - tint_subgroup_size)), (tint_subgroup_size > 32u));
(*tint_module_vars.tint_subgroup_size_mask)[0u] = v_3;
(*tint_module_vars.tint_subgroup_size_mask)[1u] = v_4;
(*tint_module_vars.prevent_dce) = subgroupBallot_1a8251(tint_module_vars);
}