libgl-xlib: enable galahad support
authorBrian Paul <brianp@vmware.com>
Fri, 3 Sep 2010 22:33:17 +0000 (16:33 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 3 Sep 2010 22:33:20 +0000 (16:33 -0600)
If the GALLIUM_GALAHAD env var is 1 we'll wrap the regular driver with
the galahad validation driver.

src/gallium/targets/libgl-xlib/Makefile
src/gallium/targets/libgl-xlib/SConscript
src/gallium/targets/libgl-xlib/xlib.c

index fe0541543ab1985ce02b0289117cab318ea55b3e..88cc0cca6a4df2bf1305691d275f45eb34519af6 100644 (file)
@@ -25,7 +25,8 @@ INCLUDE_DIRS = \
        $(X11_CFLAGS)
 
 DEFINES += \
-       -DGALLIUM_SOFTPIPE
+       -DGALLIUM_SOFTPIPE \
+       -DGALLIUM_GALAHAD
 #-DGALLIUM_CELL will be defined by the config */
 
 XLIB_TARGET_SOURCES = \
index 88e216a65be30a39297ae4096f11d36bf9de6302..27b562e1d5d6ffae7d8362675066a83e28d02382 100644 (file)
@@ -48,6 +48,10 @@ if True:
     env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE')
     env.Prepend(LIBS = [softpipe])
 
+if True:
+    env.Append(CPPDEFINES = 'GALLIUM_GALAHAD')
+    env.Prepend(LIBS = [galahad])
+
 if env['llvm']:
     env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE')
     env.Tool('udis86')
index 5a9c80c856666e9d7ac01f2f1e34748947fdd363..5914f63352a147da59faad17761bf5da4f44bbc5 100644 (file)
@@ -78,6 +78,10 @@ st_api_create_OpenGL()
 #include "cell/ppu/cell_public.h"
 #endif
 
+#ifdef GALLIUM_GALAHAD
+#include "galahad/glhd_public.h"
+#endif
+
 static struct pipe_screen *
 swrast_create_screen(struct sw_winsys *winsys)
 {
@@ -112,6 +116,14 @@ swrast_create_screen(struct sw_winsys *winsys)
       screen = softpipe_create_screen( winsys );
 #endif
 
+#if defined(GALLIUM_GALAHAD)
+   if (screen) {
+      struct pipe_screen *galahad_screen = galahad_screen_create(screen);
+      if (galahad_screen)
+         screen = galahad_screen;
+   }
+#endif
+
    return screen;
 }