gallium/target-helpers: add OpenSWR driver
authorTim Rowley <timothy.o.rowley@intel.com>
Wed, 24 Feb 2016 23:45:55 +0000 (17:45 -0600)
committerTim Rowley <timothy.o.rowley@intel.com>
Thu, 3 Mar 2016 00:38:41 +0000 (18:38 -0600)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/target-helpers/inline_sw_helper.h

index a9ab16f2b544ee3622ffe2f4dadbf477743fc784..5bb77a5bde23f35348a4bb3ea66cc915bc05f8ee 100644 (file)
@@ -6,6 +6,9 @@
 #include "util/u_debug.h"
 #include "state_tracker/sw_winsys.h"
 
+#ifdef GALLIUM_SWR
+#include "swr/swr_public.h"
+#endif
 
 /* Helper function to choose and instantiate one of the software rasterizers:
  * llvmpipe, softpipe.
@@ -43,10 +46,15 @@ sw_screen_create_named(struct sw_winsys *winsys, const char *driver)
 #endif
 
 #if defined(GALLIUM_SOFTPIPE)
-   if (screen == NULL)
+   if (screen == NULL && strcmp(driver, "softpipe") == 0)
       screen = softpipe_create_screen(winsys);
 #endif
 
+#if defined(GALLIUM_SWR)
+   if (screen == NULL && strcmp(driver, "swr") == 0)
+      screen = swr_create_screen(winsys);
+#endif
+
    return screen;
 }
 
@@ -61,6 +69,8 @@ sw_screen_create(struct sw_winsys *winsys)
    default_driver = "llvmpipe";
 #elif defined(GALLIUM_SOFTPIPE)
    default_driver = "softpipe";
+#elif defined(GALLIUM_SWR)
+   default_driver = "swr";
 #else
    default_driver = "";
 #endif