From 41e8dec75cdb3d06a94fb958f3063d8704e814d4 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Thu, 4 Feb 2021 08:43:25 -0800 Subject: [PATCH] wgl: Disable automatic use of layered drivers with LIBGL_ALWAYS_SOFTWARE Fixes: 8955980f ("gallium/targets/libgl-gdi: prefer d3d12 driver") Reviewed-by: Jose Fonseca Tested-by: Prodea Alexandru-Liviu Part-of: --- src/gallium/targets/libgl-gdi/libgl_gdi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/targets/libgl-gdi/libgl_gdi.c b/src/gallium/targets/libgl-gdi/libgl_gdi.c index 6c36c0dfd8c..119612ba9c5 100644 --- a/src/gallium/targets/libgl-gdi/libgl_gdi.c +++ b/src/gallium/targets/libgl-gdi/libgl_gdi.c @@ -37,6 +37,7 @@ #include #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", -- 2.34.1