diff options
author | Brian Paul <[email protected]> | 2016-11-15 15:56:04 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-11-16 09:34:10 -0700 |
commit | cd724208d3e1e3307f84a794f2c1fc83b69ccf8a (patch) | |
tree | 5c128458c722d6ce5d2b94babdb9bb43acc2b3a1 /src/mesa/main/debug.c | |
parent | fb17b7f99dc30a1c976f0f99cfe6572c538a381f (diff) |
mesa: if MESA_DEBUG=context, create a debug context
A number of drivers report useful debug/perf information accessible
through GL_ARB_debug_output and with debug contexts (i.e. setting the
GLX_CONTEXT_DEBUG_BIT_ARB flag). But few applications actually use
the GL_ARB_debug_output extension.
This change lets one set the MESA_DEBUG env var to "context" to force-set
a debug context and report debug/perf messages to stderr (or whatever
file MESA_LOG_FILE is set to). This is a useful debugging tool.
The small change in st_api_create_context() is needed so that
st_update_debug_callback() gets called to hook up the driver debug
callbacks when ST_CONTEXT_FLAG_DEBUG was not set, but MESA_DEBUG=context.
v2: use %.*s format string instead of allocating temporary buffer.
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main/debug.c')
-rw-r--r-- | src/mesa/main/debug.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 5ca7d5ce500..3471b26aad8 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -189,7 +189,8 @@ set_debug_flags(const char *str) { "silent", DEBUG_SILENT }, /* turn off debug messages */ { "flush", DEBUG_ALWAYS_FLUSH }, /* flush after each drawing command */ { "incomplete_tex", DEBUG_INCOMPLETE_TEXTURE }, - { "incomplete_fbo", DEBUG_INCOMPLETE_FBO } + { "incomplete_fbo", DEBUG_INCOMPLETE_FBO }, + { "context", DEBUG_CONTEXT } /* force set GL_CONTEXT_FLAG_DEBUG_BIT flag */ }; GLuint i; |