ebiten: bug fix: assigning to arguments doesn't work with OpenGL

Updates #2166
This commit is contained in:
Hajime Hoshi 2022-08-16 23:07:08 +09:00
parent f8c4634017
commit 9bd46cb2b5

View File

@ -1198,10 +1198,11 @@ func TestShaderDrawRect(t *testing.T) {
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
// Adjust texCoord into [0, 1].
t := texCoord
origin, size := imageSrcRegionOnTexture()
texCoord -= origin
texCoord /= size
if texCoord.x >= 0.5 && texCoord.y >= 0.5 {
t -= origin
t /= size
if t.x >= 0.5 && t.y >= 0.5 {
return vec4(1, 0, 0, 1)
}
return vec4(0, 1, 0, 1)