wgl: Disable automatic use of layered drivers with LIBGL_ALWAYS_SOFTWARE
authorJesse Natalie <jenatali@microsoft.com>
Thu, 4 Feb 2021 16:43:25 +0000 (08:43 -0800)
committerMarge Bot <eric+marge@anholt.net>
Fri, 12 Feb 2021 17:00:38 +0000 (17:00 +0000)
Fixes: 8955980f ("gallium/targets/libgl-gdi: prefer d3d12 driver")
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Tested-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8865>

src/gallium/targets/libgl-gdi/libgl_gdi.c

index 6c36c0dfd8cd14e33375a284b7bc77a3bb420153..119612ba9c5ace8f29b3239318783d1d06eafd46 100644 (file)
@@ -37,6 +37,7 @@
 #include <windows.h>
 
 #include "util/u_debug.h"
+#include "util/debug.h"
 #include "stw_winsys.h"
 #include "stw_device.h"
 #include "gdi/gdi_sw_winsys.h"
@@ -124,6 +125,7 @@ static struct pipe_screen *
 gdi_screen_create(HDC hDC)
 {
    struct sw_winsys *winsys;
+   UNUSED bool sw_only = env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false);
 
    winsys = gdi_create_sw_winsys();
    if (!winsys)
@@ -132,7 +134,7 @@ gdi_screen_create(HDC hDC)
    const char *const drivers[] = {
       debug_get_option("GALLIUM_DRIVER", ""),
 #ifdef GALLIUM_D3D12
-      "d3d12",
+      sw_only ? "" : "d3d12",
 #endif
 #if defined(GALLIUM_LLVMPIPE)
       "llvmpipe",