blob: 281e9bb22a2d9e3d7700905e48a5e3e105489491 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
#define TINT_ISOLATE_UB(VOLATILE_NAME) \
volatile bool VOLATILE_NAME = true; \
if (VOLATILE_NAME)
struct tint_private_vars_struct {
bool tint_discarded;
};
fragment void tint_symbol(device int* tint_symbol_1 [[buffer(0)]], device float* tint_symbol_2 [[buffer(1)]]) {
thread tint_private_vars_struct tint_private_vars = {};
tint_private_vars.tint_discarded = false;
if ((*(tint_symbol_1) < 0)) {
tint_private_vars.tint_discarded = true;
}
if (!(tint_private_vars.tint_discarded)) {
*(tint_symbol_2) = dfdx(1.0f);
}
if ((*(tint_symbol_2) < 0.0f)) {
int i = 0;
TINT_ISOLATE_UB(tint_volatile_true) while(true) {
if ((*(tint_symbol_2) > float(i))) {
if (!(tint_private_vars.tint_discarded)) {
*(tint_symbol_2) = float(i);
}
if (tint_private_vars.tint_discarded) {
discard_fragment();
}
return;
}
{
i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
if ((i == 5)) { break; }
}
}
if (tint_private_vars.tint_discarded) {
discard_fragment();
}
return;
}
if (tint_private_vars.tint_discarded) {
discard_fragment();
}
return;
}