diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index f45dbf7561e..7773a18e451 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -25,6 +25,7 @@ #include "util/u_memory.h" #include "util/u_sampler.h" #include "util/u_upload_mgr.h" +#include "util/u_debug_cb.h" #include "util/os_time.h" #include "vl/vl_decoder.h" #include "vl/vl_video_buffer.h" @@ -367,18 +368,6 @@ static void r300_init_states(struct pipe_context *pipe) } } -static void -r300_set_debug_callback(struct pipe_context *context, - const struct util_debug_callback *cb) -{ - struct r300_context *r300 = r300_context(context); - - if (cb) - r300->debug = *cb; - else - memset(&r300->debug, 0, sizeof(r300->debug)); -} - struct pipe_context* r300_create_context(struct pipe_screen* screen, void *priv, unsigned flags) { @@ -394,7 +383,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->context.screen = screen; r300->context.priv = priv; - r300->context.set_debug_callback = r300_set_debug_callback; + r300->context.set_debug_callback = u_default_set_debug_callback; r300->context.destroy = r300_destroy_context; diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 60016a3a01f..a8228801dff 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -547,8 +547,6 @@ struct r300_context { /* Occlusion query. */ struct r300_atom query_start; - struct util_debug_callback debug; - /* The pointers to the first and the last atom. */ struct r300_atom *first_dirty, *last_dirty; diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c index 934f2300f9c..13abe6fe031 100644 --- a/src/gallium/drivers/r300/r300_fs.c +++ b/src/gallium/drivers/r300/r300_fs.c @@ -432,7 +432,7 @@ static void r300_translate_fragment_shader( compiler.code = &shader->code; compiler.state = shader->compare_state; if (!shader->dummy) - compiler.Base.debug = &r300->debug; + compiler.Base.debug = &r300->context.debug; compiler.Base.is_r500 = r300->screen->caps.is_r500; compiler.Base.is_r400 = r300->screen->caps.is_r400; compiler.Base.disable_optimizations = DBG_ON(r300, DBG_NO_OPT); diff --git a/src/gallium/drivers/r300/r300_vs.c b/src/gallium/drivers/r300/r300_vs.c index 776d838f695..2ffaf629d23 100644 --- a/src/gallium/drivers/r300/r300_vs.c +++ b/src/gallium/drivers/r300/r300_vs.c @@ -195,7 +195,7 @@ void r300_translate_vertex_shader(struct r300_context *r300, DBG_ON(r300, DBG_VP) ? compiler.Base.Debug |= RC_DBG_LOG : 0; compiler.code = &vs->code; compiler.UserData = vs; - compiler.Base.debug = &r300->debug; + compiler.Base.debug = &r300->context.debug; compiler.Base.is_r500 = r300->screen->caps.is_r500; compiler.Base.disable_optimizations = DBG_ON(r300, DBG_NO_OPT); compiler.Base.has_half_swizzles = FALSE;