On Wed, Oct 23, 2013 at 12:41 PM, Courtney Goeltzenleuchter <court...@lunarg.com> wrote: > 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. > --- > 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 0d1f71c..8218153 100644 > --- a/src/mesa/main/context.c > +++ b/src/mesa/main/context.c > @@ -1522,7 +1522,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);
I think I'd go ahead and make the same change for version, renderer, and vendor now that the context is directly available. Although, I've never heard of MESA_INFO before. It doesn't appear in any of my IRC logs going back to April 2011 so I don't think anyone else even knows about it, much less suggests it for debugging. It's also not mentioned in the Mesa docs. I don't see any information in it that would be useful that glxinfo doesn't already provide. Maybe we should just throw the whole function out. _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev