blob: f562caae949376d1fb5ab9f157127085f4c4127b [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct tint_module_vars_struct {
thread bool* continue_execution;
};
#define TINT_ISOLATE_UB(VOLATILE_NAME) \
{volatile bool VOLATILE_NAME = false; if (VOLATILE_NAME) break;}
struct tint_symbol_outputs {
int tint_symbol_1 [[color(2)]];
};
struct tint_symbol_inputs {
int3 x [[user(locn1)]] [[flat]];
};
int f(int x, tint_module_vars_struct tint_module_vars) {
if ((x == 10)) {
(*tint_module_vars.continue_execution) = false;
}
return x;
}
int tint_symbol_inner(int3 x, tint_module_vars_struct tint_module_vars) {
int y = x[0u];
{
while(true) {
TINT_ISOLATE_UB(tint_volatile_false)
int const r = f(y, tint_module_vars);
if ((r == 0)) {
break;
}
{
}
continue;
}
}
if (!((*tint_module_vars.continue_execution))) {
discard_fragment();
}
return y;
}
fragment tint_symbol_outputs tint_symbol(tint_symbol_inputs inputs [[stage_in]]) {
thread bool continue_execution = true;
tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.continue_execution=(&continue_execution)};
tint_symbol_outputs tint_wrapper_result = {};
tint_wrapper_result.tint_symbol_1 = tint_symbol_inner(inputs.x, tint_module_vars);
return tint_wrapper_result;
}