mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-01 20:21:23 +00:00
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>
25 lines
390 B
HLSL
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;
|
|
}
|