mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
gpu/internal/opengl: handle switch from non-sRGB output to sRGB output
The opengl example has a screenshot functionality that renders to a non-sRGB texture, whereas window rendering is to a sRGB capable EGL surface. The opengl driver detects the switch from an sRGB capable output to a non-sRGB capable output, but not the switch back. This change releases the emulation framebuffer on the switch back. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -244,6 +244,9 @@ func (b *Backend) BeginFrame(target driver.RenderTarget, clear bool, viewport im
|
||||
panic(err)
|
||||
}
|
||||
renderFBO = b.sRGBFBO.Framebuffer()
|
||||
} else if b.sRGBFBO != nil {
|
||||
b.sRGBFBO.Release()
|
||||
b.sRGBFBO = nil
|
||||
}
|
||||
} else {
|
||||
b.glstate.set(b.funcs, gl.FRAMEBUFFER_SRGB, true)
|
||||
|
||||
Reference in New Issue
Block a user