2022-11-09 19:58:59 +00:00
|
|
|
static bool tint_discarded = false;
|
2022-03-28 20:51:32 +00:00
|
|
|
|
2021-11-10 14:38:34 +00:00
|
|
|
int f(int x) {
|
2022-03-28 20:51:32 +00:00
|
|
|
if ((x == 10)) {
|
2022-11-09 19:58:59 +00:00
|
|
|
tint_discarded = true;
|
2021-11-10 14:38:34 +00:00
|
|
|
}
|
2022-03-28 20:51:32 +00:00
|
|
|
return x;
|
2021-11-10 14:38:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct tint_symbol_1 {
|
2022-01-25 01:01:39 +00:00
|
|
|
nointerpolation int3 x : TEXCOORD1;
|
2021-11-10 14:38:34 +00:00
|
|
|
};
|
|
|
|
struct tint_symbol_2 {
|
|
|
|
int value : SV_Target2;
|
|
|
|
};
|
|
|
|
|
|
|
|
int main_inner(int3 x) {
|
|
|
|
int y = x.x;
|
2022-09-29 16:53:58 +00:00
|
|
|
while (true) {
|
2021-11-10 14:38:34 +00:00
|
|
|
const int r = f(y);
|
|
|
|
if ((r == 0)) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return y;
|
|
|
|
}
|
|
|
|
|
|
|
|
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
|
|
|
|
const int inner_result = main_inner(tint_symbol.x);
|
|
|
|
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
|
|
|
|
wrapper_result.value = inner_result;
|
2022-11-09 19:58:59 +00:00
|
|
|
if (tint_discarded) {
|
|
|
|
discard;
|
|
|
|
}
|
2021-11-10 14:38:34 +00:00
|
|
|
return wrapper_result;
|
|
|
|
}
|