mesa/st: remove st_context from debug callback
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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, ... )
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user