From c4111dad314848fee057344026e87dfa64755bb6 Mon Sep 17 00:00:00 2001 From: David Hogan Date: Thu, 13 Feb 2020 06:52:24 +1100 Subject: [PATCH] Fixed OpenGL extension detection for extensions promoted to OpenGL core. For a given OpenGL context, macOS in particular does not support enumeration / detection of OpenGL features that have been promoted to core OpenGL functionality. It is possible other drivers are the same. This change assumes support for GL_ARB_texture_non_power_of_two with OpenGL 2.0+, GL_ARB_texture_rectangle with OpenGL 3.1+ and GL_EXT_framebuffer_blit with OpenGL 3.0+. I failed to find definitive information on whether GL_GREMEDY_frame_terminator has been promoted to OpenGL core, or whether GL_ANGLE_framebuffer_blit or GL_EXT_unpack_subimage have been promoted to core in OpenGL ES. This change results in a significant GtkGLArea performance boost on macOS. Closes #2428 --- gdk/gdkglcontext.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index 4a01b2bab9..5ab960335b 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -1007,10 +1007,10 @@ gdk_gl_context_check_extensions (GdkGLContext *context) } else { - has_npot = epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two"); - has_texture_rectangle = epoxy_has_gl_extension ("GL_ARB_texture_rectangle"); + has_npot = priv->gl_version >= 20 || epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two"); + has_texture_rectangle = priv->gl_version >= 31 || epoxy_has_gl_extension ("GL_ARB_texture_rectangle"); - priv->has_gl_framebuffer_blit = epoxy_has_gl_extension ("GL_EXT_framebuffer_blit"); + priv->has_gl_framebuffer_blit = priv->gl_version >= 30 || epoxy_has_gl_extension ("GL_EXT_framebuffer_blit"); priv->has_frame_terminator = epoxy_has_gl_extension ("GL_GREMEDY_frame_terminator"); priv->has_unpack_subimage = TRUE; priv->has_khr_debug = epoxy_has_gl_extension ("GL_KHR_debug");