shader: Refactoring

This commit is contained in:
Hajime Hoshi 2020-09-08 02:43:41 +09:00
parent 0a0401e217
commit 1786be55f7

View File

@ -321,8 +321,8 @@ func (c *compileContext) metalBlock(p *shaderir.Program, topBlock, block *shader
var lines []string
for i, t := range block.LocalVars {
// The type is None e.g., when the variable is a for-loop counter.
name := localVariableName(p, topBlock, block.LocalVarIndexOffset+i)
if t.Main != shaderir.None {
name := localVariableName(p, topBlock, block.LocalVarIndexOffset+i)
lines = append(lines, fmt.Sprintf("%s%s = %s;", idt, c.metalVarDecl(p, &t, name, false, false), c.metalVarInit(p, &t)))
}
}