Mesa (master): mesa: Update MESA_INFO to eliminate error

Kenneth Graunke kwg at kemper.freedesktop.org
Thu Nov 21 08:25:59 UTC 2013


Module: Mesa
Branch: master
Commit: f56f875b8b72eda5abf124c8c4203b77b44b9670
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f56f875b8b72eda5abf124c8c4203b77b44b9670

Author: Courtney Goeltzenleuchter <courtney at lunarg.com>
Date:   Thu Oct 24 13:13:57 2013 -0600

mesa: Update MESA_INFO to eliminate error

If a user set MESA_INFO and the OpenGL application uses a
3.0 or later context then the MESA_INFO debug output will have
an error when it queries for extensions using the deprecated
enum GL_EXTENSIONS. Passing context argument allows code
to return extension list directly regardless of profile.
Commit title updated as recommended by Kenneth Graunke.

Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/main/context.c |    2 +-
 src/mesa/main/debug.c   |   10 +++++++---
 src/mesa/main/debug.h   |    2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 8cbc935..87a4a35 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1535,7 +1535,7 @@ _mesa_make_current( struct gl_context *newCtx,
           * information.
           */
 	 if (_mesa_getenv("MESA_INFO")) {
-	    _mesa_print_info();
+	    _mesa_print_info(newCtx);
 	 }
 
 	 newCtx->FirstTimeCurrent = GL_FALSE;
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index 9434c1e..99b2147 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -103,7 +103,7 @@ _mesa_print_state( const char *msg, GLuint state )
 /**
  * Print information about this Mesa version and build options.
  */
-void _mesa_print_info( void )
+void _mesa_print_info( struct gl_context *ctx )
 {
    _mesa_debug(NULL, "Mesa GL_VERSION = %s\n",
 	   (char *) _mesa_GetString(GL_VERSION));
@@ -111,8 +111,12 @@ void _mesa_print_info( void )
 	   (char *) _mesa_GetString(GL_RENDERER));
    _mesa_debug(NULL, "Mesa GL_VENDOR = %s\n",
 	   (char *) _mesa_GetString(GL_VENDOR));
-   _mesa_debug(NULL, "Mesa GL_EXTENSIONS = %s\n",
-	   (char *) _mesa_GetString(GL_EXTENSIONS));
+
+   /* use ctx as GL_EXTENSIONS will not work on 3.0 or higher
+    * core contexts.
+    */
+   _mesa_debug(NULL, "Mesa GL_EXTENSIONS = %s\n", ctx->Extensions.String);
+
 #if defined(THREADS)
    _mesa_debug(NULL, "Mesa thread-safe: YES\n");
 #else
diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h
index 8414c5e..902f595 100644
--- a/src/mesa/main/debug.h
+++ b/src/mesa/main/debug.h
@@ -43,7 +43,7 @@ struct gl_texture_image;
 
 extern void _mesa_print_enable_flags( const char *msg, GLuint flags );
 extern void _mesa_print_state( const char *msg, GLuint state );
-extern void _mesa_print_info( void );
+extern void _mesa_print_info( struct gl_context *ctx );
 extern void _mesa_init_debug( struct gl_context *ctx );
 
 extern void




More information about the mesa-commit mailing list