diff --git a/.pick_status.json b/.pick_status.json index 1ff49963c84..d83f5622701 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2551,7 +2551,7 @@ "description": "drisw: Disable automatic use of layered drivers with LIBGL_ALWAYS_SOFTWARE", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "4a3b42a717ce4fa4450066352f04f2e1ef78ad9a" }, diff --git a/src/gallium/auxiliary/target-helpers/inline_sw_helper.h b/src/gallium/auxiliary/target-helpers/inline_sw_helper.h index ba803d4cda3..c494840c44e 100644 --- a/src/gallium/auxiliary/target-helpers/inline_sw_helper.h +++ b/src/gallium/auxiliary/target-helpers/inline_sw_helper.h @@ -4,6 +4,7 @@ #include "pipe/p_compiler.h" #include "util/u_debug.h" +#include "util/debug.h" #include "frontend/sw_winsys.h" #include "target-helpers/inline_debug_helper.h" @@ -77,13 +78,14 @@ sw_screen_create_named(struct sw_winsys *winsys, const char *driver) static inline struct pipe_screen * sw_screen_create(struct sw_winsys *winsys) { + UNUSED bool only_sw = env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false); const char *drivers[] = { debug_get_option("GALLIUM_DRIVER", ""), #if defined(GALLIUM_ZINK) - "zink", + only_sw ? "" : "zink", #endif #if defined(GALLIUM_D3D12) - "d3d12", + only_sw ? "" : "d3d12", #endif #if defined(GALLIUM_LLVMPIPE) "llvmpipe", diff --git a/src/gallium/auxiliary/target-helpers/sw_helper.h b/src/gallium/auxiliary/target-helpers/sw_helper.h index a4eb9ee1067..d9469d9f5e3 100644 --- a/src/gallium/auxiliary/target-helpers/sw_helper.h +++ b/src/gallium/auxiliary/target-helpers/sw_helper.h @@ -4,6 +4,7 @@ #include "pipe/p_compiler.h" #include "util/u_debug.h" +#include "util/debug.h" #include "target-helpers/sw_helper_public.h" #include "frontend/sw_winsys.h" @@ -82,13 +83,14 @@ sw_screen_create_named(struct sw_winsys *winsys, const char *driver) struct pipe_screen * sw_screen_create(struct sw_winsys *winsys) { + UNUSED bool only_sw = env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false); const char *drivers[] = { debug_get_option("GALLIUM_DRIVER", ""), #if defined(GALLIUM_ZINK) - "zink", + only_sw ? "" : "zink", #endif #if defined(GALLIUM_D3D12) - "d3d12", + only_sw ? "" : "d3d12", #endif #if defined(GALLIUM_LLVMPIPE) "llvmpipe",