1 #include "pipe/p_compiler.h"
2 #include "util/u_debug.h"
3 #include "target-helpers/wrap_screen.h"
5 #include "state_tracker/sw_winsys.h"
8 /* Helper function to choose and instantiate one of the software rasterizers:
9 * cell, llvmpipe, softpipe.
12 #ifdef GALLIUM_SOFTPIPE
13 #include "softpipe/sp_public.h"
16 #ifdef GALLIUM_LLVMPIPE
17 #include "llvmpipe/lp_public.h"
21 #include "cell/ppu/cell_public.h"
25 swrast_create_screen(struct sw_winsys
*winsys
)
27 const char *default_driver
;
29 struct pipe_screen
*screen
= NULL
;
31 #if defined(GALLIUM_CELL)
32 default_driver
= "cell";
33 #elif defined(GALLIUM_LLVMPIPE)
34 default_driver
= "llvmpipe";
35 #elif defined(GALLIUM_SOFTPIPE)
36 default_driver
= "softpipe";
41 driver
= debug_get_option("GALLIUM_DRIVER", default_driver
);
43 #if defined(GALLIUM_CELL)
44 if (screen
== NULL
&& strcmp(driver
, "cell") == 0)
45 screen
= cell_create_screen( winsys
);
48 #if defined(GALLIUM_LLVMPIPE)
49 if (screen
== NULL
&& strcmp(driver
, "llvmpipe") == 0)
50 screen
= llvmpipe_create_screen( winsys
);
53 #if defined(GALLIUM_SOFTPIPE)
55 screen
= softpipe_create_screen( winsys
);