diff --git a/internal/shader/shader.go b/internal/shader/shader.go index a9f27e683..a3c4ba0c4 100644 --- a/internal/shader/shader.go +++ b/internal/shader/shader.go @@ -302,7 +302,7 @@ func (cs *compileState) parseDecl(b *block, d ast.Decl) ([]shaderir.Stmt, bool) continue } - base := len(b.vars) + base := b.totalLocalVariableNum() b.vars = append(b.vars, vs...) if len(inits) > 0 {