summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2021-05-10 18:36:32 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2021-05-10 20:44:35 +0100
commit6600b0b507e374b9ec21cbbfc9fc8e02665fbf94 (patch)
tree4919a87cc14930bc8b9fd19f8a1756e2115f69e8
parent9a19e3c7410be977159abb12674a3e76e1d3184f (diff)
downloadgtk+-6600b0b507e374b9ec21cbbfc9fc8e02665fbf94.tar.gz
x11: Add debug toggle for preferring GLX
Mostly as a way to compare the EGL and GLX implementations.
-rw-r--r--gdk/gdk.c1
-rw-r--r--gdk/gdkdebug.h7
-rw-r--r--gdk/x11/gdkglcontext-x11.c9
3 files changed, 11 insertions, 6 deletions
diff --git a/gdk/gdk.c b/gdk/gdk.c
index 5cd0e1922d..0970cbc8d1 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -126,6 +126,7 @@ static const GdkDebugKey gdk_debug_keys[] = {
{ "gl-legacy", GDK_DEBUG_GL_LEGACY, "Use a legacy OpenGL context" },
{ "gl-gles", GDK_DEBUG_GL_GLES, "Use a GLES OpenGL context" },
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
+ { "gl-glx", GDK_DEBUG_GL_GLX, "Use GLX on X11" },
{ "vulkan-disable", GDK_DEBUG_VULKAN_DISABLE, "Disable Vulkan support" },
{ "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE, "Load the Vulkan validation layer" },
{ "default-settings",GDK_DEBUG_DEFAULT_SETTINGS, "Force default values for xsettings" },
diff --git a/gdk/gdkdebug.h b/gdk/gdkdebug.h
index 2098774739..e03b904ce4 100644
--- a/gdk/gdkdebug.h
+++ b/gdk/gdkdebug.h
@@ -41,9 +41,10 @@ typedef enum {
GDK_DEBUG_GL_LEGACY = 1 << 15,
GDK_DEBUG_GL_GLES = 1 << 16,
GDK_DEBUG_GL_DEBUG = 1 << 17,
- GDK_DEBUG_VULKAN_DISABLE = 1 << 18,
- GDK_DEBUG_VULKAN_VALIDATE = 1 << 19,
- GDK_DEBUG_DEFAULT_SETTINGS= 1 << 20
+ GDK_DEBUG_GL_GLX = 1 << 18,
+ GDK_DEBUG_VULKAN_DISABLE = 1 << 19,
+ GDK_DEBUG_VULKAN_VALIDATE = 1 << 20,
+ GDK_DEBUG_DEFAULT_SETTINGS= 1 << 21
} GdkDebugFlags;
extern guint _gdk_debug_flags;
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 1d9f5675df..9f7fc89343 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -238,9 +238,12 @@ gdk_x11_screen_init_gl (GdkX11Screen *screen)
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_DISABLE))
return FALSE;
- /* We favour EGL */
- if (gdk_x11_screen_init_egl (screen))
- return TRUE;
+ if (!GDK_DISPLAY_DEBUG_CHECK (display, GL_GLX))
+ {
+ /* We favour EGL */
+ if (gdk_x11_screen_init_egl (screen))
+ return TRUE;
+ }
if (gdk_x11_screen_init_glx (screen))
return TRUE;