shader: Refactoring

This commit is contained in:
Hajime Hoshi 2020-08-10 02:02:26 +09:00
parent e534fe8246
commit 4d20da9bc0

View File

@ -673,10 +673,10 @@ func (cs *compileState) parseBlock(outer *block, fname string, stmts []ast.Stmt,
offset = 0
case outer.outer == nil:
offset = len(inParams) + len(outParams)
case outer.outer.outer == nil:
offset = len(outer.outer.vars) + len(outer.vars)
default:
offset = outer.ir.LocalVarIndexOffset + len(outer.vars)
for b := outer; b != nil; b = b.outer {
offset += len(b.vars)
}
}
block := &block{