From 923b4413a63530be37cd44eed29910db21b39ac6 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 8 Apr 2009 15:30:31 +0100 Subject: wgl: Integrate the trace driver on debug builds. --- .../state_trackers/wgl/shared/stw_context.c | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/gallium/state_trackers/wgl/shared/stw_context.c') diff --git a/src/gallium/state_trackers/wgl/shared/stw_context.c b/src/gallium/state_trackers/wgl/shared/stw_context.c index 82aabe0a7e..f890225242 100644 --- a/src/gallium/state_trackers/wgl/shared/stw_context.c +++ b/src/gallium/state_trackers/wgl/shared/stw_context.c @@ -33,6 +33,12 @@ #include "pipe/p_context.h" #include "state_tracker/st_context.h" #include "state_tracker/st_public.h" + +#ifdef DEBUG +#include "trace/tr_screen.h" +#include "trace/tr_context.h" +#endif + #include "shared/stw_device.h" #include "shared/stw_winsys.h" #include "shared/stw_framebuffer.h" @@ -77,6 +83,7 @@ stw_create_layer_context( const struct pixelformat_info *pf = NULL; struct stw_context *ctx = NULL; GLvisual *visual = NULL; + struct pipe_screen *screen = NULL; struct pipe_context *pipe = NULL; UINT_PTR hglrc = 0; @@ -120,10 +127,24 @@ stw_create_layer_context( if (visual == NULL) goto fail; - pipe = stw_dev->stw_winsys->create_context( stw_dev->screen ); + screen = stw_dev->screen; + +#ifdef DEBUG + /* Unwrap screen */ + if(stw_dev->trace_running) + screen = trace_screen(screen)->screen; +#endif + + pipe = stw_dev->stw_winsys->create_context( screen ); if (pipe == NULL) goto fail; +#ifdef DEBUG + /* Wrap context */ + if(stw_dev->trace_running) + pipe = trace_context_create(stw_dev->screen, pipe); +#endif + assert(!pipe->priv); pipe->priv = hdc; -- cgit v1.2.3