internal/graphicsdriver/opengl: better place to reset uniform variables

Updates #2517
This commit is contained in:
Hajime Hoshi 2023-01-04 01:36:02 +09:00
parent 599be725b9
commit cf76e3c646

View File

@ -61,6 +61,11 @@ func (g *Graphics) End(present bool) error {
// Call glFlush to prevent black flicking (especially on Android (#226) and iOS).
// TODO: examples/sprites worked without this. Is this really needed?
g.context.ctx.Flush()
// The last uniforms must be reset after swapping the buffer (#2517).
if present {
g.state.resetLastUniforms()
}
return nil
}
@ -265,11 +270,6 @@ func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcIDs [graphics.
g.context.ctx.Disable(gl.STENCIL_TEST)
}
// The last uniforms must be reset after swapping the buffer (#2517).
if destination.screen {
g.state.resetLastUniforms()
}
return nil
}