mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-08 02:45:38 +00:00
gpu: reset to the default framebuffer on reset
The macOS backend doesn't re-create contexts, holding on to the first created instead. Make sure the GPU leaves the default framebuffer bound, in case the context is re-used. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -50,6 +50,11 @@ func (c *context) Release() {
|
|||||||
c.Lock()
|
c.Lock()
|
||||||
defer c.Unlock()
|
defer c.Unlock()
|
||||||
C.gio_clearCurrentContext()
|
C.gio_clearCurrentContext()
|
||||||
|
// We could release the context with [view clearGLContext]
|
||||||
|
// and rely on [view openGLContext] auto-creating a new context.
|
||||||
|
// However that second context is not properly set up by
|
||||||
|
// OpenGLContextView, so we'll stay on the safe side and keep
|
||||||
|
// the first context around.
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *context) Present() error {
|
func (c *context) Present() error {
|
||||||
|
|||||||
@@ -354,6 +354,7 @@ func (g *GPU) BeginFrame() {
|
|||||||
g.ctx.SetBlend(false)
|
g.ctx.SetBlend(false)
|
||||||
g.renderer.pather.stenciler.invalidateFBO()
|
g.renderer.pather.stenciler.invalidateFBO()
|
||||||
g.coverTimer.end()
|
g.coverTimer.end()
|
||||||
|
g.ctx.BindFramebuffer(g.defFBO)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GPU) EndFrame() {
|
func (g *GPU) EndFrame() {
|
||||||
|
|||||||
Reference in New Issue
Block a user