gl: Print max texture size in debug output
authorMatthias Clasen <mclasen@redhat.com>
Wed, 15 Mar 2023 02:12:00 +0000 (22:12 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 15 Mar 2023 02:13:37 +0000 (22:13 -0400)
This is useful information.

gdk/gdkglcontext.c

index a46ffdb9d9c63940419b75f52141c961fa72f2d6..5f6047378b8e9166aa8e2a750606f15ce9678465 100644 (file)
@@ -1546,20 +1546,28 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
   priv->has_half_float = gdk_gl_context_check_version (context, 3, 0, 3, 0) ||
                          epoxy_has_gl_extension ("OES_vertex_half_float");
 
-  GDK_DISPLAY_DEBUG (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), OPENGL,
-                     "%s version: %d.%d (%s)\n"
-                     "* GLSL version: %s\n"
-                     "* Extensions checked:\n"
-                     " - GL_KHR_debug: %s\n"
-                     " - GL_EXT_unpack_subimage: %s\n"
-                     " - OES_vertex_half_float: %s",
-                     gdk_gl_context_get_use_es (context) ? "OpenGL ES" : "OpenGL",
-                     priv->gl_version / 10, priv->gl_version % 10,
-                     priv->is_legacy ? "legacy" : "core",
-                     glGetString (GL_SHADING_LANGUAGE_VERSION),
-                     priv->has_khr_debug ? "yes" : "no",
-                     priv->has_unpack_subimage ? "yes" : "no",
-                     priv->has_half_float ? "yes" : "no");
+#ifdef G_ENABLE_DEBUG
+  {
+    int max_texture_size;
+    glGetIntegerv (GL_MAX_TEXTURE_SIZE, &max_texture_size);
+    GDK_DISPLAY_DEBUG (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), OPENGL,
+                       "%s version: %d.%d (%s)\n"
+                       "* GLSL version: %s\n"
+                       "* Max texture size: %d\n"
+                       "* Extensions checked:\n"
+                       " - GL_KHR_debug: %s\n"
+                       " - GL_EXT_unpack_subimage: %s\n"
+                       " - OES_vertex_half_float: %s",
+                       gdk_gl_context_get_use_es (context) ? "OpenGL ES" : "OpenGL",
+                       priv->gl_version / 10, priv->gl_version % 10,
+                       priv->is_legacy ? "legacy" : "core",
+                       glGetString (GL_SHADING_LANGUAGE_VERSION),
+                       max_texture_size,
+                       priv->has_khr_debug ? "yes" : "no",
+                       priv->has_unpack_subimage ? "yes" : "no",
+                       priv->has_half_float ? "yes" : "no");
+  }
+#endif
 
   priv->extensions_checked = TRUE;
 }