naga
naga copied to clipboard
[hlsl-out] scoping issue with switch statement fallthrough
WGSL:
fn main() {
var x = 0;
switch (x) {
case -1: {
fallthrough;
}
default: {
let var_2 = i32(11632);
}
}
}
HLSL:
void main()
{
int x = 0;
int _expr2 = x;
switch(_expr2) {
case -1: {
{
}
{
int var_2_ = int(11632);
}
break;
}
default: {
int var_2_1 = var_2_;
break;
}
}
}
var_2_
is declared in the first case block but there is an invalid use in the default
block. This looks like a recent regression since I think it was fine on an older commit of naga.