From: Benjamin Otte Date: Wed, 6 Oct 2021 00:41:31 +0000 (+0200) Subject: egl: Support EGL_KHR_no_config_context X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~5^2~258^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bc7c0d05f8ac6e02d256795706aecf169f9cd702;p=gtk4.git egl: Support EGL_KHR_no_config_context If the extension is supported, we create configless contexts. This will come in handy real soon now, we use different configs for HDR and SDR. --- diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c index c3aed432a1..cedd0856bc 100644 --- a/gdk/gdkdisplay.c +++ b/gdk/gdkdisplay.c @@ -1698,6 +1698,8 @@ gdk_display_init_egl (GdkDisplay *self, epoxy_has_egl_extension (priv->egl_display, "EGL_EXT_buffer_age"); self->have_egl_swap_buffers_with_damage = epoxy_has_egl_extension (priv->egl_display, "EGL_EXT_swap_buffers_with_damage"); + self->have_egl_no_config_context = + epoxy_has_egl_extension (priv->egl_display, "EGL_KHR_no_config_context"); GDK_DISPLAY_NOTE (self, OPENGL, { char *ext = describe_extensions (priv->egl_display); diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h index 8c92f42679..3b7a18f4b3 100644 --- a/gdk/gdkdisplayprivate.h +++ b/gdk/gdkdisplayprivate.h @@ -108,6 +108,7 @@ struct _GdkDisplay /* egl info */ guint have_egl_buffer_age : 1; guint have_egl_swap_buffers_with_damage : 1; + guint have_egl_no_config_context : 1; }; struct _GdkDisplayClass diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index 527ef62773..0fc8b689cc 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -359,7 +359,7 @@ gdk_gl_context_real_realize (GdkGLContext *context, if (egl_display) { - EGLConfig egl_config = gdk_display_get_egl_config (display); + EGLConfig egl_config; GdkGLContext *share = gdk_display_get_gl_context (display); GdkGLContextPrivate *share_priv = gdk_gl_context_get_instance_private (share); EGLContext ctx; @@ -377,6 +377,11 @@ gdk_gl_context_real_realize (GdkGLContext *context, use_es = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES) || (share != NULL && gdk_gl_context_get_use_es (share)); + if (display->have_egl_no_config_context) + egl_config = NULL; + else + egl_config = gdk_display_get_egl_config (display); + flags = 0; if (debug_bit)