diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index c7a5857be49..8455bae9947 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -2774,15 +2774,16 @@ tc_set_debug_callback(struct pipe_context *_pipe, struct threaded_context *tc = threaded_context(_pipe); struct pipe_context *pipe = tc->pipe; + tc_sync(tc); + /* Drop all synchronous debug callbacks. Drivers are expected to be OK * with this. shader-db will use an environment variable to disable * the threaded context. */ - if (cb && cb->debug_message && !cb->async) - return; - - tc_sync(tc); - pipe->set_debug_callback(pipe, cb); + if (cb && !cb->async) + pipe->set_debug_callback(pipe, NULL); + else + pipe->set_debug_callback(pipe, cb); } static void