trace: Prevent tracing internal pipe driver calls.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Sat, 9 Aug 2008 10:53:56 +0000 (11:53 +0100)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Sat, 9 Aug 2008 13:10:25 +0000 (14:10 +0100)
src/gallium/drivers/trace/tr_context.c
src/gallium/drivers/trace/tr_screen.c

index 242a03ccb04b5f6724f67fb0f213e24ce2361809..47a217ec7c755c4ef6e9eb6b58fecf5799b6e4ca 100644 (file)
@@ -30,6 +30,7 @@
 #include "tr_stream.h"
 #include "tr_dump.h"
 #include "tr_state.h"
+#include "tr_winsys.h"
 #include "tr_screen.h"
 #include "tr_context.h"
 
@@ -999,14 +1000,11 @@ trace_context_destroy(struct pipe_context *_pipe)
 struct pipe_context *
 trace_context_create(struct pipe_context *pipe)
 {
-   struct trace_screen *tr_scr;
    struct trace_context *tr_ctx;
    
    if(!debug_get_bool_option("GALLIUM_TRACE", FALSE))
       return pipe;
    
-   tr_scr = trace_screen(pipe->screen);
-   
    tr_ctx = CALLOC_STRUCT(trace_context);
    if(!tr_ctx)
       return NULL;
@@ -1058,8 +1056,9 @@ trace_context_create(struct pipe_context *pipe)
 
    tr_ctx->pipe = pipe;
    
-   /* We don't want to trace the pipe calls */
-   pipe->screen = tr_scr->screen;
+   /* We don't want to trace the internal pipe calls */
+   pipe->winsys = trace_winsys(pipe->winsys)->winsys;
+   pipe->screen = trace_screen(pipe->screen)->screen;
    
    return &tr_ctx->base;
 }
index b40d56bcff35cefc8b5475d3dd217638cd310105..de885abae2c318e18d024078aa08fadcbf56f30d 100644 (file)
@@ -376,5 +376,8 @@ trace_screen_create(struct pipe_screen *screen)
    if(!tr_scr->stream)
       return NULL;
 
+   /* We don't want to trace the internal pipe calls */
+   screen->winsys = trace_winsys(screen->winsys)->winsys;
+
    return &tr_scr->base;
 }