shaaderir: Use gl_FragColor

This commit is contained in:
Hajime Hoshi 2020-05-23 18:18:22 +09:00
parent da4d5b1338
commit 125f85effe
2 changed files with 6 additions and 4 deletions

View File

@ -219,8 +219,10 @@ func (p *Program) glslBlock(b *Block, level int, localVarIndex int) []string {
return fmt.Sprintf("V%d", idx)
case idx == nv:
return "gl_FragCoord"
case idx == nv+1:
return "gl_FragColor"
default:
return fmt.Sprintf("l%d", idx-(nv+1))
return fmt.Sprintf("l%d", idx-(nv+2))
}
default:
return fmt.Sprintf("l%d", idx)

View File

@ -757,9 +757,9 @@ void main(void) {
vec2 l0;
vec4 l1;
float l2;
l2 = V0;
l0 = V1;
l1 = gl_FragCoord;
l1 = V0;
gl_FragColor = V1;
l0 = gl_FragCoord;
}`,
},
}