Skip to content

Commit f2392d5

Browse files
sagudevVecvec
authored andcommitted
Do not add local const to named expr
Signed-off-by: sagudev <[email protected]>
1 parent 0dd6ccb commit f2392d5

File tree

1 file changed

+1
-8
lines changed
  • naga/src/front/wgsl/lower

1 file changed

+1
-8
lines changed

naga/src/front/wgsl/lower/mod.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,7 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {
16041604
c.ty.map(|ast| self.resolve_ast_type(ast, &mut ectx.as_const()))
16051605
.transpose()?;
16061606

1607-
let (ty, init) = self.type_and_init(
1607+
let (_ty, init) = self.type_and_init(
16081608
c.name,
16091609
Some(c.init),
16101610
explicit_ty,
@@ -1616,13 +1616,6 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {
16161616
block.extend(emitter.finish(&ctx.function.expressions));
16171617
ctx.local_table
16181618
.insert(c.handle, Declared::Const(Typed::Plain(init)));
1619-
// Only add constants of non-abstract types to the named expressions
1620-
// to prevent abstract types ending up in the IR.
1621-
let is_abstract = ctx.module.types[ty].inner.is_abstract(&ctx.module.types);
1622-
if !is_abstract {
1623-
ctx.named_expressions
1624-
.insert(init, (c.name.name.to_string(), c.name.span));
1625-
}
16261619
return Ok(());
16271620
}
16281621
},

0 commit comments

Comments
 (0)