summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-10-05 14:08:55 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-10-05 14:43:31 -0400
commit7311464c67ea1d67c1e64f867ffe8d4fc401629a (patch)
tree22c2ad669ce7e11b48da88651fd3bcf6bd1780cb /gdk
parentaaab461c2701b6c1e373a3302e902edb9a88371d (diff)
downloadgtk+-7311464c67ea1d67c1e64f867ffe8d4fc401629a.tar.gz
gl: Install the debug message callback for gl-debug
Always install the debug message callback when we can and GDK_DEBUG=gl-debug is specified. Previously, we were only installing the callback when the build was a non-optimized debug build.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdkglcontext.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c
index 71a854816b..01c67688f2 100644
--- a/gdk/gdkglcontext.c
+++ b/gdk/gdkglcontext.c
@@ -864,7 +864,7 @@ gdk_gl_context_get_use_es (GdkGLContext *context)
return priv->use_es > 0;
}
-#ifdef G_ENABLE_CONSISTENCY_CHECKS
+#ifdef G_ENABLE_DEBUG
static void
gl_debug_message_callback (GLenum source,
GLenum type,
@@ -1008,8 +1008,11 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
priv->has_debug_output = epoxy_has_gl_extension ("GL_ARB_debug_output") ||
epoxy_has_gl_extension ("GL_KHR_debug");
-#ifdef G_ENABLE_CONSISTENCY_CHECKS
- if (priv->has_debug_output)
+#ifdef G_ENABLE_DEBUG
+ display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
+ gl_debug = GDK_DISPLAY_DEBUG_CHECK (display, GL_DEBUG);
+
+ if (priv->has_debug_output && gl_debug)
{
gdk_gl_context_make_current (context);
glEnable (GL_DEBUG_OUTPUT);
@@ -1039,11 +1042,6 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
priv->is_legacy = TRUE;
}
-#ifdef G_ENABLE_DEBUG
- display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
- gl_debug = GDK_DISPLAY_DEBUG_CHECK (display, GL_DEBUG);
-#endif
-
if (priv->has_khr_debug && gl_debug)
{
priv->use_khr_debug = TRUE;