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:
14 #ifdef GALLIUM_SOFTPIPE
15 #include "softpipe/sp_public.h"
18 #ifdef GALLIUM_LLVMPIPE
19 #include "llvmpipe/lp_public.h"
23 #include "virgl/virgl_public.h"
24 #include "virgl/vtest/virgl_vtest_public.h"
27 static inline struct pipe_screen
*
28 sw_screen_create_named(struct sw_winsys
*winsys
, const char *driver
)
30 struct pipe_screen
*screen
= NULL
;
32 #if defined(GALLIUM_LLVMPIPE)
33 if (screen
== NULL
&& strcmp(driver
, "llvmpipe") == 0)
34 screen
= llvmpipe_create_screen(winsys
);
37 #if defined(GALLIUM_VIRGL)
38 if (screen
== NULL
&& strcmp(driver
, "virpipe") == 0) {
39 struct virgl_winsys
*vws
;
40 vws
= virgl_vtest_winsys_wrap(winsys
);
41 screen
= virgl_create_screen(vws
);
45 #if defined(GALLIUM_SOFTPIPE)
47 screen
= softpipe_create_screen(winsys
);
54 static inline struct pipe_screen
*
55 sw_screen_create(struct sw_winsys
*winsys
)
57 const char *default_driver
;
60 #if defined(GALLIUM_LLVMPIPE)
61 default_driver
= "llvmpipe";
62 #elif defined(GALLIUM_SOFTPIPE)
63 default_driver
= "softpipe";
68 driver
= debug_get_option("GALLIUM_DRIVER", default_driver
);
69 return sw_screen_create_named(winsys
, driver
);