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:
Elias Naur
2021-08-19 10:13:07 +02:00
parent 3773daf155
commit f475087296
+3
View File
@@ -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)