On Thu Oct 12 14:28:34 2023 +0000, Giovanni Mascellani wrote:
Actually, it seems that `continue` in a `switch` is outright forbidden:
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:
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).
Added these tests, and updated the check.