[Mesa-dev] [PATCH 3/4] glxinfo/wglinfo: print (110) instead of empty line

Brian Paul brianp at vmware.com
Mon Mar 5 16:53:03 UTC 2018


The GL_SHADING_LANGUAGE_VERSION query returns an empty string for
GLSL 1.10.  Instead of printing an empty line, print (110).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105285
---
 src/xdemos/glinfo_common.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/xdemos/glinfo_common.c b/src/xdemos/glinfo_common.c
index 57dccc8..f84d1a4 100644
--- a/src/xdemos/glinfo_common.c
+++ b/src/xdemos/glinfo_common.c
@@ -745,8 +745,15 @@ print_limits(const char *extensions, const char *oglstring, int version,
       glGetIntegerv(GL_NUM_SHADING_LANGUAGE_VERSIONS, &n);
       printf("    GL_NUM_SHADING_LANGUAGE_VERSIONS = %d\n", n);
       for (i = 0; i < n; i++) {
-         printf("      %s\n", (const char *)
-                extfuncs->GetStringi(GL_SHADING_LANGUAGE_VERSION, i));
+         const char *lang = (const char *)
+            extfuncs->GetStringi(GL_SHADING_LANGUAGE_VERSION, i);
+         if (lang[0] == 0) {
+            /* The empty string is really GLSL 1.10.  Instead of
+             * printing an empty line, print (110).
+             */
+            lang = "(110)";
+         }
+         printf("      %s\n", lang);
       }
    }
 #endif
-- 
2.7.4



More information about the mesa-dev mailing list