mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
gpu: fix depth buffer corruption on the Fairphone 2
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-1
@@ -342,8 +342,10 @@ func (g *GPU) BeginFrame() {
|
||||
}
|
||||
g.ctx.BindFramebuffer(g.defFBO)
|
||||
g.ctx.DepthFunc(backend.DepthFuncGreater)
|
||||
g.ctx.ClearDepth(0.0)
|
||||
// Note that Clear must be before ClearDepth if nothing else is rendered
|
||||
// (len(zimageOps) == 0). If not, the Fairphone 2 will corrupt the depth buffer.
|
||||
g.ctx.Clear(g.drawOps.clearColor.Float32())
|
||||
g.ctx.ClearDepth(0.0)
|
||||
g.ctx.Viewport(0, 0, viewport.X, viewport.Y)
|
||||
g.renderer.drawZOps(g.drawOps.zimageOps)
|
||||
g.zopsTimer.end()
|
||||
|
||||
Reference in New Issue
Block a user