Mesa (master): gallium: Added SWR support for gdi

Tim Rowley torowley at kemper.freedesktop.org
Mon Nov 21 18:51:08 UTC 2016


Module: Mesa
Branch: master
Commit: 915b4b0d494ad9705a7be59baec9e11a5576503a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=915b4b0d494ad9705a7be59baec9e11a5576503a

Author: George Kyriazis <george.kyriazis at intel.com>
Date:   Wed Nov  9 16:40:58 2016 -0600

gallium: Added SWR support for gdi

Added hooks for screen creation and swap.  Still keep llvmpipe the default
software renderer.

v2: split from bigger patch
v3: reword commit message

Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

---

 src/gallium/targets/libgl-gdi/libgl_gdi.c | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/gallium/targets/libgl-gdi/libgl_gdi.c b/src/gallium/targets/libgl-gdi/libgl_gdi.c
index 922c186..12576db 100644
--- a/src/gallium/targets/libgl-gdi/libgl_gdi.c
+++ b/src/gallium/targets/libgl-gdi/libgl_gdi.c
@@ -51,9 +51,12 @@
 #include "llvmpipe/lp_public.h"
 #endif
 
+#ifdef HAVE_SWR
+#include "swr/swr_public.h"
+#endif
 
 static boolean use_llvmpipe = FALSE;
-
+static boolean use_swr = FALSE;
 
 static struct pipe_screen *
 gdi_screen_create(void)
@@ -69,6 +72,8 @@ gdi_screen_create(void)
 
 #ifdef HAVE_LLVMPIPE
    default_driver = "llvmpipe";
+#elif HAVE_SWR
+   default_driver = "swr";
 #else
    default_driver = "softpipe";
 #endif
@@ -78,15 +83,21 @@ gdi_screen_create(void)
 #ifdef HAVE_LLVMPIPE
    if (strcmp(driver, "llvmpipe") == 0) {
       screen = llvmpipe_create_screen( winsys );
+      if (screen)
+         use_llvmpipe = TRUE;
+   }
+#endif
+#ifdef HAVE_SWR
+   if (strcmp(driver, "swr") == 0) {
+      screen = swr_create_screen( winsys );
+      if (screen)
+         use_swr = TRUE;
    }
-#else
-   (void) driver;
 #endif
+   (void) driver;
 
    if (screen == NULL) {
       screen = softpipe_create_screen( winsys );
-   } else {
-      use_llvmpipe = TRUE;
    }
 
    if(!screen)
@@ -128,6 +139,13 @@ gdi_present(struct pipe_screen *screen,
    }
 #endif
 
+#ifdef HAVE_SWR
+   if (use_swr) {
+      swr_gdi_swap(screen, res, hDC);
+      return;
+   }
+#endif
+
    winsys = softpipe_screen(screen)->winsys,
    dt = softpipe_resource(res)->dt,
    gdi_sw_display(winsys, dt, hDC);




More information about the mesa-commit mailing list