Import('*')
-if not 'softpipe' in env['drivers']:
- print 'warning: softpipe driver not built skipping swrastg_dri.so'
+if not set(('softpipe', 'llvmpipe')).intersection(env['drivers']):
+ print 'warning: no supported pipe driver: skipping build of swrastg_dri.so'
Return()
env = drienv.Clone()
env.Prepend(LIBS = [
st_drisw,
ws_dri,
- softpipe,
trace,
mesa,
glsl,
COMMON_DRI_SW_OBJECTS
])
+if 'softpipe' in env['drivers']:
+ env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE')
+ env.Prepend(LIBS = [softpipe])
+
+if 'llvmpipe' in env['drivers']:
+ env.Tool('llvm')
+ if 'LLVM_VERSION' in env:
+ env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE')
+ env.Tool('udis86')
+ env.Prepend(LIBS = [llvmpipe])
+
swrastg_sources = [
'swrast_drm_api.c'
]
#include "pipe/p_compiler.h"
#include "util/u_memory.h"
-
-#include "softpipe/sp_public.h"
#include "state_tracker/drm_api.h"
#include "state_tracker/sw_winsys.h"
#include "dri_sw_winsys.h"
+#ifdef GALLIUM_SOFTPIPE
+#include "softpipe/sp_public.h"
+#endif
+
+#ifdef GALLIUM_LLVMPIPE
+#include "llvmpipe/lp_public.h"
+#endif
+
static struct pipe_screen *
swrast_create_screen(struct drm_api *api,
int drmFD,
if (winsys == NULL)
return NULL;
- screen = softpipe_create_screen( winsys );
- if (screen == NULL)
+#ifdef GALLIUM_LLVMPIPE
+ if (!screen)
+ screen = llvmpipe_create_screen(winsys);
+#endif
+
+#ifdef GALLIUM_SOFTPIPE
+ if (!screen)
+ screen = softpipe_create_screen(winsys);
+#endif
+
+ if (!screen)
goto fail;
return screen;
fail:
if (winsys)
- winsys->destroy( winsys );
+ winsys->destroy(winsys);
return NULL;
}