diff --git a/src/gallium/auxiliary/driver_trace/tr_screen.c b/src/gallium/auxiliary/driver_trace/tr_screen.c index 56a70de894a..90ee53617a1 100644 --- a/src/gallium/auxiliary/driver_trace/tr_screen.c +++ b/src/gallium/auxiliary/driver_trace/tr_screen.c @@ -670,15 +670,11 @@ trace_screen_destroy(struct pipe_screen *_screen) bool trace_enabled(void) { - static bool firstrun = true; - - if (!firstrun) - return trace; - firstrun = false; - - if(trace_dump_trace_begin()) { - trace_dumping_start(); - trace = true; + do_once { + if(trace_dump_trace_begin()) { + trace_dumping_start(); + trace = true; + } } return trace;