sw: Remove unnecessary header.
[mesa.git] / src / gallium / drivers / sw / sw.c
1 #include "pipe/p_compiler.h"
2 #include "util/u_debug.h"
3 #include "target-helpers/wrap_screen.h"
4 #include "sw_public.h"
5
6
7 /* Helper function to choose and instantiate one of the software rasterizers:
8 * cell, llvmpipe, softpipe.
9 */
10
11 #ifdef GALLIUM_SOFTPIPE
12 #include "softpipe/sp_public.h"
13 #endif
14
15 #ifdef GALLIUM_LLVMPIPE
16 #include "llvmpipe/lp_public.h"
17 #endif
18
19 #ifdef GALLIUM_CELL
20 #include "cell/ppu/cell_public.h"
21 #endif
22
23 struct pipe_screen *
24 swrast_create_screen(struct sw_winsys *winsys)
25 {
26 const char *default_driver;
27 const char *driver;
28 struct pipe_screen *screen = NULL;
29
30 #if defined(GALLIUM_CELL)
31 default_driver = "cell";
32 #elif defined(GALLIUM_LLVMPIPE)
33 default_driver = "llvmpipe";
34 #elif defined(GALLIUM_SOFTPIPE)
35 default_driver = "softpipe";
36 #else
37 default_driver = "";
38 #endif
39
40 driver = debug_get_option("GALLIUM_DRIVER", default_driver);
41
42 #if defined(GALLIUM_CELL)
43 if (screen == NULL && strcmp(driver, "cell") == 0)
44 screen = cell_create_screen( winsys );
45 #endif
46
47 #if defined(GALLIUM_LLVMPIPE)
48 if (screen == NULL && strcmp(driver, "llvmpipe") == 0)
49 screen = llvmpipe_create_screen( winsys );
50 #endif
51
52 #if defined(GALLIUM_SOFTPIPE)
53 if (screen == NULL)
54 screen = softpipe_create_screen( winsys );
55 #endif
56
57 return screen;
58 }