st/egl: Move sw screen creation to native helper.
[mesa.git] / src / gallium / state_trackers / egl / common / native_helper.c
index 7832b2b693f572d904183a8cbe2d2e8ca12be663..206817ed666e237cfd558371380e1d920eccb972 100644 (file)
@@ -31,6 +31,9 @@
 #include "pipe/p_screen.h"
 #include "pipe/p_context.h"
 #include "pipe/p_state.h"
+#include "softpipe/sp_public.h"
+#include "llvmpipe/lp_public.h"
+#include "target-helpers/wrap_screen.h"
 
 #include "native_helper.h"
 
@@ -233,3 +236,18 @@ resource_surface_present(struct resource_surface *rsurf,
 
    return TRUE;
 }
+
+struct pipe_screen *
+native_create_sw_screen(struct sw_winsys *ws)
+{
+   struct pipe_screen *screen = NULL;
+
+#if defined(GALLIUM_LLVMPIPE)
+   if (!screen && !debug_get_bool_option("GALLIUM_NO_LLVM", FALSE))
+      screen = llvmpipe_create_screen(ws);
+#endif
+   if (!screen)
+      screen = softpipe_create_screen(ws);
+
+   return (screen) ? gallium_wrap_screen(screen) : NULL;
+}