mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
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:
+5
-1
@@ -751,7 +751,11 @@ func floatTripleFor(f Functions, ver [2]int, exts []string) (textureTriple, erro
|
|||||||
if ver[0] >= 3 {
|
if ver[0] >= 3 {
|
||||||
triples = append(triples, textureTriple{R16F, Enum(RED), Enum(HALF_FLOAT)})
|
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.
|
// Try single channel.
|
||||||
triples = append(triples, textureTriple{LUMINANCE, Enum(LUMINANCE), Enum(HALF_FLOAT_OES)})
|
triples = append(triples, textureTriple{LUMINANCE, Enum(LUMINANCE), Enum(HALF_FLOAT_OES)})
|
||||||
// Fallback to 4 channels.
|
// Fallback to 4 channels.
|
||||||
|
|||||||
Reference in New Issue
Block a user