drisw: Disable automatic use of layered drivers with LIBGL_ALWAYS_SOFTWARE
If LIBGL_ALWAYS_SOFTWARE is set, then drisw is selected, and internally,
drisw should choose one of the actual software drivers. If it's not set,
but drisw is still selected (no hardware DRM driver, like in WSL), then
layered drivers are preferred over pure software.
Fixes: 4a3b42a7 ("drisw: Prefer hardware-layered sw-winsys drivers over pure sw")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4171
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8782>
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user