Mesa (master): libgl-gdi: support building without softpipe

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 9 17:16:31 UTC 2020


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

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Fri Apr  3 11:44:30 2020 +0200

libgl-gdi: support building without softpipe

While we do need *some* fallback-driver, there's no good reason to
*always* require that to be Softpipe. LLVMpipe for instance does the job
just fine.

This makes the minimal build a bit smaller on Windows.

Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7506>

---

 src/gallium/targets/libgl-gdi/SConscript  |  1 +
 src/gallium/targets/libgl-gdi/libgl_gdi.c | 16 +++++++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/gallium/targets/libgl-gdi/SConscript b/src/gallium/targets/libgl-gdi/SConscript
index 5255125ca09..754cdc1688b 100644
--- a/src/gallium/targets/libgl-gdi/SConscript
+++ b/src/gallium/targets/libgl-gdi/SConscript
@@ -29,6 +29,7 @@ sources = ['libgl_gdi.c']
 drivers = []
 
 if True:
+    env.Append(CPPDEFINES = ['GALLIUM_SOFTPIPE'])
     drivers += [softpipe]
 
 if env['llvm']:
diff --git a/src/gallium/targets/libgl-gdi/libgl_gdi.c b/src/gallium/targets/libgl-gdi/libgl_gdi.c
index 59094ec1aa1..5f4fbacc3c5 100644
--- a/src/gallium/targets/libgl-gdi/libgl_gdi.c
+++ b/src/gallium/targets/libgl-gdi/libgl_gdi.c
@@ -41,9 +41,11 @@
 #include "stw_device.h"
 #include "gdi/gdi_sw_winsys.h"
 
+#ifdef GALLIUM_SOFTPIPE
 #include "softpipe/sp_texture.h"
 #include "softpipe/sp_screen.h"
 #include "softpipe/sp_public.h"
+#endif
 
 #ifdef GALLIUM_LLVMPIPE
 #include "llvmpipe/lp_texture.h"
@@ -78,8 +80,10 @@ gdi_screen_create(void)
    default_driver = "llvmpipe";
 #elif GALLIUM_SWR
    default_driver = "swr";
-#else
+#elif defined(GALLIUM_SOFTPIPE)
    default_driver = "softpipe";
+#else
+#error "no suitable default-driver"
 #endif
 
    driver = debug_get_option("GALLIUM_DRIVER", default_driver);
@@ -100,11 +104,11 @@ gdi_screen_create(void)
 #endif
    (void) driver;
 
-   if (screen == NULL) {
+#ifdef GALLIUM_SOFTPIPE
+   if (screen == NULL)
       screen = softpipe_create_screen( winsys );
-   }
-
-   if(!screen)
+#endif
+   if (!screen)
       goto no_screen;
 
    return screen;
@@ -150,9 +154,11 @@ gdi_present(struct pipe_screen *screen,
    }
 #endif
 
+#ifdef GALLIUM_SOFTPIPE
    winsys = softpipe_screen(screen)->winsys,
    dt = softpipe_resource(res)->dt,
    gdi_sw_display(winsys, dt, hDC);
+#endif
 }
 
 



More information about the mesa-commit mailing list