gpu/gl: detect float FBO support under Safari's WebGL1 implementation

Safari's WebGL does not advertise support for EXT_color_buffer_half_float,
but does support rendering to float FBOs.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-04-28 14:54:59 +02:00
parent 1062d4e79d
commit 9842cbd30b
+5 -1
View File
@@ -751,7 +751,11 @@ func floatTripleFor(f Functions, ver [2]int, exts []string) (textureTriple, erro
if ver[0] >= 3 {
triples = append(triples, textureTriple{R16F, Enum(RED), Enum(HALF_FLOAT)})
}
if hasExtension(exts, "GL_OES_texture_half_float") && hasExtension(exts, "GL_EXT_color_buffer_half_float") {
// According to the OES_texture_half_float specification, EXT_color_buffer_half_float is needed to
// render to FBOs. However, the Safari WebGL1 implementation does support half-float FBOs but does not
// report EXT_color_buffer_half_float support. The triples are verified below, so it doesn't matter if we're
// wrong.
if hasExtension(exts, "GL_OES_texture_half_float") || hasExtension(exts, "GL_EXT_color_buffer_half_float") {
// Try single channel.
triples = append(triples, textureTriple{LUMINANCE, Enum(LUMINANCE), Enum(HALF_FLOAT_OES)})
// Fallback to 4 channels.