dawn-cmake/test/tint/loops/continue_in_switch.wgsl.expected.hlsl
Antonio Maiorano b349710476 HLSL: workaround FXC error "continue cannot be used in a switch"
Added a new transform::RemoveContinueInSwitch that replaces continue
statements in switch cases with setting a bool variable, and checking if
the variable is set after the switch to continue.

Bug: tint:1080
Change-Id: I3c0a6c790e1bb612fac3f927a4bd5beb2d0d4ed1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/84960
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2022-03-31 15:02:25 +00:00

25 lines
390 B
HLSL

[numthreads(1, 1, 1)]
void f() {
{
[loop] for(int i = 0; (i < 4); i = (i + 1)) {
bool tint_continue = false;
switch(i) {
case 0: {
{
tint_continue = true;
break;
}
break;
}
default: {
break;
}
}
if (tint_continue) {
continue;
}
}
}
return;
}