aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/trace/tr_screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/trace/tr_screen.c')
-rw-r--r--src/gallium/drivers/trace/tr_screen.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c
index 920f418ebf0..5b1e26a52d7 100644
--- a/src/gallium/drivers/trace/tr_screen.c
+++ b/src/gallium/drivers/trace/tr_screen.c
@@ -38,6 +38,7 @@
static boolean trace = FALSE;
+static boolean rbug = FALSE;
static const char *
trace_screen_get_name(struct pipe_screen *_screen)
@@ -837,18 +838,11 @@ trace_screen_destroy(struct pipe_screen *_screen)
boolean
trace_enabled(void)
{
- return trace;
-}
+ static boolean firstrun = TRUE;
-struct pipe_screen *
-trace_screen_create(struct pipe_screen *screen)
-{
- struct trace_screen *tr_scr;
- struct pipe_winsys *winsys;
- boolean rbug = FALSE;
-
- if(!screen)
- goto error1;
+ if (!firstrun)
+ return trace;
+ firstrun = FALSE;
trace_dump_init();
@@ -862,7 +856,19 @@ trace_screen_create(struct pipe_screen *screen)
rbug = TRUE;
}
- if (!trace)
+ return trace;
+}
+
+struct pipe_screen *
+trace_screen_create(struct pipe_screen *screen)
+{
+ struct trace_screen *tr_scr;
+ struct pipe_winsys *winsys;
+
+ if(!screen)
+ goto error1;
+
+ if (!trace_enabled())
goto error1;
trace_dump_call_begin("", "pipe_screen_create");