summaryrefslogtreecommitdiff
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.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c
index 12a8535342..bc14248eeb 100644
--- a/src/gallium/drivers/trace/tr_screen.c
+++ b/src/gallium/drivers/trace/tr_screen.c
@@ -30,13 +30,15 @@
#include "tr_buffer.h"
#include "tr_dump.h"
-#include "tr_state.h"
+#include "tr_dump_state.h"
#include "tr_texture.h"
#include "tr_screen.h"
#include "pipe/p_inlines.h"
+static boolean trace = FALSE;
+
static const char *
trace_screen_get_name(struct pipe_screen *_screen)
{
@@ -212,10 +214,12 @@ static struct pipe_texture *
trace_screen_texture_blanket(struct pipe_screen *_screen,
const struct pipe_texture *templat,
const unsigned *ppitch,
- struct pipe_buffer *buffer)
+ struct pipe_buffer *_buffer)
{
struct trace_screen *tr_scr = trace_screen(_screen);
+ struct trace_buffer *tr_buf = trace_buffer(_buffer);
struct pipe_screen *screen = tr_scr->screen;
+ struct pipe_buffer *buffer = tr_buf->buffer;
unsigned pitch = *ppitch;
struct pipe_texture *result;
@@ -818,16 +822,20 @@ trace_screen_destroy(struct pipe_screen *_screen)
struct pipe_screen *screen = tr_scr->screen;
trace_dump_call_begin("pipe_screen", "destroy");
-
trace_dump_arg(ptr, screen);
+ trace_dump_call_end();
+ trace_dump_trace_end();
screen->destroy(screen);
- trace_dump_call_end();
+ FREE(tr_scr);
+}
- trace_dump_trace_end();
- FREE(tr_scr);
+boolean
+trace_enabled(void)
+{
+ return trace;
}
@@ -842,10 +850,13 @@ trace_screen_create(struct pipe_screen *screen)
trace_dump_init();
- if(!trace_dump_trace_begin())
- goto error1;
+ if(trace_dump_trace_begin()) {
+ trace_dumping_start();
+ trace = TRUE;
+ }
- trace_dumping_start();
+ if (!trace)
+ goto error1;
trace_dump_call_begin("", "pipe_screen_create");