summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2010-03-09 15:58:45 +0000
committerKeith Whitwell <[email protected]>2010-03-09 15:58:45 +0000
commit999932bf1feed4cbf834b2c81510aab09dda56dc (patch)
treeb8ee7b890f9bf3b5e55220d834af5b7b1853beee /src/gallium/targets
parent3c57c01a44c294e69d902207b2ec94d28a397a51 (diff)
targets/libgl-xlib: add code to inject trace and identity layers
Finally we can inject layers for debug, trace and "other" with relative ease between state-tracker and driver.
Diffstat (limited to 'src/gallium/targets')
-rw-r--r--src/gallium/targets/libgl-xlib/Makefile2
-rw-r--r--src/gallium/targets/libgl-xlib/xlib.c16
2 files changed, 17 insertions, 1 deletions
diff --git a/src/gallium/targets/libgl-xlib/Makefile b/src/gallium/targets/libgl-xlib/Makefile
index 8ffe4dbf242..5a4e035c2eb 100644
--- a/src/gallium/targets/libgl-xlib/Makefile
+++ b/src/gallium/targets/libgl-xlib/Makefile
@@ -39,6 +39,8 @@ LIBS = \
$(GALLIUM_DRIVERS) \
$(TOP)/src/gallium/state_trackers/glx/xlib/libxlib.a \
$(TOP)/src/gallium/winsys/xlib/libws_xlib.a \
+ $(TOP)/src/gallium/drivers/trace/libtrace.a \
+ $(TOP)/src/gallium/drivers/identity/libidentity.a \
$(TOP)/src/mesa/libglapi.a \
$(TOP)/src/mesa/libmesagallium.a \
$(GALLIUM_AUXILIARIES) \
diff --git a/src/gallium/targets/libgl-xlib/xlib.c b/src/gallium/targets/libgl-xlib/xlib.c
index 6651bd538ee..7881bc2cb18 100644
--- a/src/gallium/targets/libgl-xlib/xlib.c
+++ b/src/gallium/targets/libgl-xlib/xlib.c
@@ -36,8 +36,11 @@
#include "util/u_debug.h"
#include "softpipe/sp_public.h"
#include "llvmpipe/lp_public.h"
+#include "identity/id_public.h"
+#include "trace/tr_public.h"
#include "cell/ppu/cell_public.h"
+
/* advertise OpenGL support */
PUBLIC const int st_api_OpenGL = 1;
@@ -46,7 +49,7 @@ static struct pipe_screen *
create_screen( struct sw_winsys *winsys )
{
#if defined(GALLIUM_CELL)
- if (!getenv("GALLIUM_NOCELL"))
+ if (!debug_get_bool_option("GALLIUM_NOCELL", FALSE))
return cell_create_screen( winsys );
#endif
@@ -73,6 +76,17 @@ xlib_create_screen( Display *display )
if (screen == NULL)
goto fail;
+ /* Finally we have somewhere to inject layers into the stack in a
+ * clean fashion:
+ */
+ if (debug_get_bool_option("GALLIUM_WRAP", FALSE)) {
+ screen = identity_screen_create(screen);
+ }
+
+ if (debug_get_bool_option("GALLIUM_TRACE", FALSE)) {
+ screen = trace_screen_create( screen );
+ }
+
return screen;
fail: