~eliasnaur/gio

8a44ac11d8379ccb4214e5daaf113194fa95c1f3 — Elias Naur 5 months ago 7164c55
app/internal/gpu: use single channel floating point FBO if possible

Remove dependency on EXT_color_buffer_half_float, it's not clear it's
necessary. In any case the following FBO sanity check will catch invalid
FBO format combinations.

Updates #49

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 4 insertions(+), 1 deletions(-)

M app/internal/gpu/context.go
M app/internal/gpu/context.go => app/internal/gpu/context.go +4 -1
@@ 66,7 66,10 @@ func floatTripleFor(ctx *context, ver [2]int, exts []string) (textureTriple, err
	if ver[0] >= 3 {
		triples = append(triples, textureTriple{gl.R16F, gl.Enum(gl.RED), gl.Enum(gl.HALF_FLOAT)})
	}
	if hasExtension(exts, "GL_OES_texture_half_float") || hasExtension(exts, "EXT_color_buffer_half_float") {
	if hasExtension(exts, "GL_OES_texture_half_float") {
		// Try single channel.
		triples = append(triples, textureTriple{gl.LUMINANCE, gl.Enum(gl.LUMINANCE), gl.Enum(gl.HALF_FLOAT_OES)})
		// Fallback to 4 channels.
		triples = append(triples, textureTriple{gl.RGBA, gl.Enum(gl.RGBA), gl.Enum(gl.HALF_FLOAT_OES)})
	}
	if hasExtension(exts, "GL_OES_texture_float") || hasExtension(exts, "GL_EXT_color_buffer_float") {