diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c index dddc8b2060..0e935d8176 100644 --- a/gdk/gdkdisplay.c +++ b/gdk/gdkdisplay.c @@ -1727,6 +1727,8 @@ gdk_display_init_egl (GdkDisplay *self, epoxy_has_egl_extension (priv->egl_display, "EGL_KHR_no_config_context"); self->have_egl_pixel_format_float = epoxy_has_egl_extension (priv->egl_display, "EGL_EXT_pixel_format_float"); + self->have_egl_win32_libangle = + epoxy_has_egl_extension (priv->egl_display, "EGL_ANGLE_d3d_share_handle_client_buffer"); if (self->have_egl_no_config_context) priv->egl_config_high_depth = gdk_display_create_egl_config (self, diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h index cb80ad3f88..4eb3625d88 100644 --- a/gdk/gdkdisplayprivate.h +++ b/gdk/gdkdisplayprivate.h @@ -110,6 +110,7 @@ struct _GdkDisplay guint have_egl_swap_buffers_with_damage : 1; guint have_egl_no_config_context : 1; guint have_egl_pixel_format_float : 1; + guint have_egl_win32_libangle : 1; }; struct _GdkDisplayClass diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index 531344b72e..d1bc7c57c2 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -1056,26 +1056,29 @@ gdk_gl_context_get_required_version (GdkGLContext *context, { GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context); gboolean force_gles = FALSE; -#ifdef G_ENABLE_DEBUG GdkDisplay *display; -#endif int default_major, default_minor; int maj, min; g_return_if_fail (GDK_IS_GL_CONTEXT (context)); -#ifdef G_ENABLE_DEBUG display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); + +#ifdef G_ENABLE_DEBUG force_gles = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES); #endif + /* libANGLE on Windows at least requires GLES 3.0+ */ + if (display->have_egl_win32_libangle) + force_gles = TRUE; + /* Default fallback values for uninitialised contexts; we * enforce a context version number of 3.2 for desktop GL, * and 2.0 for GLES */ if (gdk_gl_context_get_use_es (context) || force_gles) { - default_major = 2; + default_major = display->have_egl_win32_libangle ? 3 : 2; default_minor = 0; } else