From 0c77a1f6caa0da9ba95a19f97de2d630c4186f38 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Wed, 14 Jan 2026 21:29:13 -0800 Subject: [PATCH] [naga wgsl-in] Remove unnecessary dependencies. Avoid adding entries to `ExpressionContext::unresolved` for identifiers that `ExpressionContext::ident_expr` has already processed. At the moment, there is no way these could cause a bug: they only occur after we've recognized a call/construction expression, and those can never refer to function-local definitions, so the string in question is certain to have already been added to `unresolved` by `ExpressionContext::ident_expr`. But they're redundant, and if Naga ever supported nested functions or local type aliases, these could end up adding extraneous dependencies. --- naga/src/front/wgsl/parse/mod.rs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/naga/src/front/wgsl/parse/mod.rs b/naga/src/front/wgsl/parse/mod.rs index dee276387..bb7ea1ba1 100644 --- a/naga/src/front/wgsl/parse/mod.rs +++ b/naga/src/front/wgsl/parse/mod.rs @@ -489,10 +489,6 @@ impl Parser { if let Token::Paren('(') = lexer.peek().0 { let arguments = self.arguments(lexer, ctx)?; - ctx.unresolved.insert(ast::Dependency { - ident: word, - usage: span, - }); ast::Expression::Call(ast::CallPhrase { function: ident, arguments, @@ -1105,11 +1101,6 @@ impl Parser { self.push_rule_span(Rule::SingularExpr, lexer); - context.unresolved.insert(ast::Dependency { - ident: name, - usage: name_span, - }); - let arguments = self.arguments(lexer, context)?; let span = lexer.span_with_start(name_span);