Make the gl-debug debug flag always available
authorMatthias Clasen <mclasen@redhat.com>
Thu, 22 Sep 2022 01:17:16 +0000 (21:17 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 22 Sep 2022 01:17:16 +0000 (21:17 -0400)
No need to restrict this to debug builds.

gdk/gdk.c
gdk/gdkglcontext.c

index cc2a81f1d42738a449794c42465fcda927bf5d4f..d4045fea5c8e509113e9de82f31b1cc372005321 100644 (file)
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -119,9 +119,9 @@ static const GdkDebugKey gdk_debug_keys[] = {
   { "nograbs",         GDK_DEBUG_NOGRABS, "Disable pointer and keyboard grabs (X11)", TRUE },
   { "portals",         GDK_DEBUG_PORTALS, "Force the use of portals", TRUE },
   { "gl-disable",      GDK_DEBUG_GL_DISABLE, "Disable OpenGL support", TRUE },
+  { "gl-debug",        GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL", TRUE },
   { "gl-legacy",       GDK_DEBUG_GL_LEGACY, "Use a legacy OpenGL context", TRUE },
   { "gl-gles",         GDK_DEBUG_GL_GLES, "Only allow OpenGL GLES API", TRUE },
-  { "gl-debug",        GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
   { "gl-egl",          GDK_DEBUG_GL_EGL, "Use EGL on X11 or Windows" },
   { "gl-glx",          GDK_DEBUG_GL_GLX, "Use GLX on X11" },
   { "gl-wgl",          GDK_DEBUG_GL_WGL, "Use WGL on Windows" },
index 0452640244d29152833ba9fbadecc8d4f3a8b5db..ac0353a029897b24252e7a8ea5987607e2d8de5d 100644 (file)
@@ -1485,9 +1485,7 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
 {
   GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
   gboolean gl_debug = FALSE;
-#ifdef G_ENABLE_DEBUG
   GdkDisplay *display;
-#endif
 
   if (!gdk_gl_context_is_realized (context))
     return;
@@ -1500,16 +1498,10 @@ 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_DEBUG
   display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
-  gl_debug = GDK_DISPLAY_DEBUG_CHECK (display, GL_DEBUG);
-#endif
+  gl_debug = (gdk_display_get_debug_flags (display) & GDK_DEBUG_GL_DEBUG) != 0;
 
-  if (priv->has_debug_output
-#ifndef G_ENABLE_CONSISTENCY_CHECKS
-      && gl_debug
-#endif
-      )
+  if (priv->has_debug_output && gl_debug)
     {
       gdk_gl_context_make_current (context);
       glEnable (GL_DEBUG_OUTPUT);