Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.y:
}
}
-static struct hlsl_scope *get_loop_scope(struct hlsl_scope *scope) +static bool is_continue_allowed(const struct hlsl_scope *scope) { if (scope->loop)
return scope;
return true;
- return scope->upper ? is_continue_allowed(scope->upper) : false;
+}
Actually, it seems that `continue` in a `switch` is outright forbidden: ```hlsl uint4 v;
float4 main() : sv_target { float4 c = {1.0, 2.0, 3.0, 4.0}; uint i, j;
for (i = 0; i < v.z; i++) { switch (v.x) { case 0: c += 0.1f; continue; break; case 1: c += 0.2f; break; } }
return c; } ```
Unless it's another another nested loop: ```hlsl uint4 v;
float4 main() : sv_target { float4 c = {1.0, 2.0, 3.0, 4.0}; uint i, j;
for (i = 0; i < v.z; i++) { switch (v.x) { case 0: for (j = 0; j < v.z; j++) { c += 0.1f; if (v.w) continue; } break; case 1: c += 0.2f; break; } }
return c; } ```
It probably makes sense to add these two tests too (or variations).