internal/shaderir/msl: refactoring

This commit is contained in:
Hajime Hoshi 2022-03-12 00:18:55 +09:00
parent 5715539a0f
commit 98e2d86ea3

View File

@ -303,9 +303,9 @@ func localVariableName(p *shaderir.Program, topBlock *shaderir.Block, idx int) s
nv := len(p.Varyings)
switch {
case idx == 0:
return fmt.Sprintf("varyings.Position")
return fmt.Sprintf("%s.Position", vertexOut)
case idx < nv+1:
return fmt.Sprintf("varyings.M%d", idx-1)
return fmt.Sprintf("%s.M%d", vertexOut, idx-1)
case idx == nv+1:
return fragmentOut
default: