diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 062fb3e8c95..bf9682ec8f0 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -76,12 +76,10 @@ DEBUG_GET_ONCE_BOOL_OPTION(mesa_mvp_dp4, "MESA_MVP_DP4", FALSE) void st_Enable(struct gl_context *ctx, GLenum cap) { - struct st_context *st = st_context(ctx); - switch (cap) { case GL_DEBUG_OUTPUT: case GL_DEBUG_OUTPUT_SYNCHRONOUS: - st_update_debug_callback(st); + st_update_debug_callback(ctx); break; default: break; diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c index b651499181c..414f4ac79d3 100644 --- a/src/mesa/state_tracker/st_debug.c +++ b/src/mesa/state_tracker/st_debug.c @@ -75,7 +75,7 @@ st_debug_message(void *data, const char *fmt, va_list args) { - struct st_context *st = data; + struct gl_context *ctx = data; enum mesa_debug_source source; enum mesa_debug_type type; enum mesa_debug_severity severity; @@ -119,23 +119,23 @@ st_debug_message(void *data, default: unreachable("invalid debug type"); } - _mesa_gl_vdebugf(st->ctx, id, source, type, severity, fmt, args); + _mesa_gl_vdebugf(ctx, id, source, type, severity, fmt, args); } void -st_update_debug_callback(struct st_context *st) +st_update_debug_callback(struct gl_context *ctx) { - struct pipe_context *pipe = st->pipe; + struct pipe_context *pipe = ctx->pipe; if (!pipe->set_debug_callback) return; - if (_mesa_get_debug_state_int(st->ctx, GL_DEBUG_OUTPUT)) { + if (_mesa_get_debug_state_int(ctx, GL_DEBUG_OUTPUT)) { struct pipe_debug_callback cb; memset(&cb, 0, sizeof(cb)); - cb.async = !_mesa_get_debug_state_int(st->ctx, GL_DEBUG_OUTPUT_SYNCHRONOUS); + cb.async = !_mesa_get_debug_state_int(ctx, GL_DEBUG_OUTPUT_SYNCHRONOUS); cb.debug_message = st_debug_message; - cb.data = st; + cb.data = ctx; pipe->set_debug_callback(pipe, &cb); } else { pipe->set_debug_callback(pipe, NULL); diff --git a/src/mesa/state_tracker/st_debug.h b/src/mesa/state_tracker/st_debug.h index 5aba19d3bd6..4d588160f6e 100644 --- a/src/mesa/state_tracker/st_debug.h +++ b/src/mesa/state_tracker/st_debug.h @@ -46,7 +46,7 @@ extern int ST_DEBUG; void st_debug_init( void ); -void st_update_debug_callback(struct st_context *st); +void st_update_debug_callback(struct gl_context *ctx); static inline void ST_DBG( unsigned flag, const char *fmt, ... ) diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 75ed0f496a9..6d8ec028b16 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -958,7 +958,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi, } if (st->ctx->Const.ContextFlags & GL_CONTEXT_FLAG_DEBUG_BIT) { - st_update_debug_callback(st); + st_update_debug_callback(st->ctx); } if (attribs->flags & ST_CONTEXT_FLAG_FORWARD_COMPATIBLE)