st/mesa: set debug callback async flag

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Nicolai Hähnle
2016-07-07 09:25:31 +02:00
parent 2909e292fc
commit 084ca0d8e5
4 changed files with 8 additions and 5 deletions

View File

@@ -27,6 +27,7 @@
#include "main/context.h"
#include "main/debug_output.h"
#include "program/prog_print.h"
#include "pipe/p_state.h"
@@ -164,16 +165,17 @@ st_debug_message(void *data,
}
void
st_enable_debug_output(struct st_context *st, boolean enable)
st_update_debug_callback(struct st_context *st)
{
struct pipe_context *pipe = st->pipe;
if (!pipe->set_debug_callback)
return;
if (enable) {
if (_mesa_get_debug_state_int(st->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.debug_message = st_debug_message;
cb.data = st;
pipe->set_debug_callback(pipe, &cb);