2 #ifndef INLINE_SW_HELPER_H
3 #define INLINE_SW_HELPER_H
5 #include "pipe/p_compiler.h"
6 #include "util/u_debug.h"
7 #include "state_tracker/sw_winsys.h"
10 /* Helper function to choose and instantiate one of the software rasterizers:
11 * cell, llvmpipe, softpipe.
14 #ifdef GALLIUM_SOFTPIPE
15 #include "softpipe/sp_public.h"
18 #ifdef GALLIUM_LLVMPIPE
19 #include "llvmpipe/lp_public.h"
23 #include "cell/ppu/cell_public.h"
26 static INLINE
struct pipe_screen
*
27 sw_screen_create(struct sw_winsys
*winsys
)
29 const char *default_driver
;
31 struct pipe_screen
*screen
= NULL
;
33 #if defined(GALLIUM_CELL)
34 default_driver
= "cell";
35 #elif defined(GALLIUM_LLVMPIPE)
36 default_driver
= "llvmpipe";
37 #elif defined(GALLIUM_SOFTPIPE)
38 default_driver
= "softpipe";
43 driver
= debug_get_option("GALLIUM_DRIVER", default_driver
);
45 #if defined(GALLIUM_CELL)
46 if (screen
== NULL
&& strcmp(driver
, "cell") == 0)
47 screen
= cell_create_screen(winsys
);
50 #if defined(GALLIUM_LLVMPIPE)
51 if (screen
== NULL
&& strcmp(driver
, "llvmpipe") == 0)
52 screen
= llvmpipe_create_screen(winsys
);
55 #if defined(GALLIUM_SOFTPIPE)
57 screen
= softpipe_create_screen(winsys
);