This variable is the Wine's equivalent of the SDL_VIDEODRIVER/ SDL_VIDEO_DRIVER variable in SDL 2 and 3 (it explicitly selects a list of graphics/video drivers to be used).
-- v2: man: Add documentation for the WINE_VIDEO_DRIVER variable. explorer: Introduce a new WINE_VIDEO_DRIVER variable.
From: Aida Jonikienė aidas957@gmail.com
This variable is the Wine's equivalent of the SDL_VIDEODRIVER/ SDL_VIDEO_DRIVER variable in SDL 2 and 3 (it explicitly selects a list of graphics/video drivers to be used). --- programs/explorer/desktop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index fb59258ad36..c573417fc9c 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -963,7 +963,7 @@ static void load_graphics_driver( const WCHAR *driver, GUID *guid ) { static const WCHAR device_keyW[] = L"System\CurrentControlSet\Control\Video\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\0000";
- WCHAR buffer[MAX_PATH], libname[32], *name, *next; + WCHAR buffer[MAX_PATH], *env_name, libname[32], *name, *next; WCHAR key[ARRAY_SIZE( device_keyW ) + 39]; BOOL null_driver = FALSE; HMODULE module = 0; @@ -975,7 +975,9 @@ static void load_graphics_driver( const WCHAR *driver, GUID *guid ) lstrcpyW( buffer, default_driver );
/* @@ Wine registry key: HKCU\Software\Wine\Drivers */ - if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Software\Wine\Drivers", &hkey )) + if ((env_name = _wgetenv( L"WINE_VIDEO_DRIVER" )) && env_name[0] != '\0') + lstrcpynW( buffer, env_name, ARRAY_SIZE( buffer )); + else if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Software\Wine\Drivers", &hkey )) { DWORD count = sizeof(buffer); RegQueryValueExW( hkey, L"Graphics", 0, NULL, (LPBYTE)buffer, &count );
From: Aida Jonikienė aidas957@gmail.com
--- loader/wine.man.in | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/loader/wine.man.in b/loader/wine.man.in index 9d7822eaf88..10f068f7b19 100644 --- a/loader/wine.man.in +++ b/loader/wine.man.in @@ -235,6 +235,18 @@ WINE_D3D_CONFIG="renderer=vulkan;VideoPciVendorID=0xc0de" If an individual setting is specified in both the environment variable and the registry, the former takes precedence. .TP +.B WINE_VIDEO_DRIVER +Specifies the list of graphics drivers Wine should try to load. It +can be used instead of modifying the +.B HKEY_CURRENT_USER\\Software\\Wine\\Drivers\\Graphics +registry value. The value is a comma-separated list of driver names +(same as the registry one). For example: +.IP +WINE_VIDEODRIVER="x11,wayland" +.IP +If the driver list is specified in both the environment variable +and the registry, the former takes precedence. +.TP .B DISPLAY Specifies the X11 display to use. .TP
I don't think this can work, an environment variable is inherently a per-process setting and the graphics driver needs to be the same for the entire prefix (or at least for a given desktop).
Wine doesn't restrict how prefix are started and it would be up to downstream wrappers to change the prefix driver when starting it, based on an environment variable if they want and only allow prefixes to be started with the main process.
On Mon Aug 19 12:03:23 2024 +0000, Rémi Bernon wrote:
I don't think this can work, an environment variable is inherently a per-process setting and the graphics driver needs to be the same for the entire prefix (or at least for a given desktop). Wine doesn't restrict how prefix are started and it would be up to downstream wrappers to change the prefix driver when starting it, based on an environment variable if they want and only allow prefixes to be started with the main process.
This is intended as a quicker and less permanent way (registry is relatively permanent) to test new graphics drivers (like winewayland) or the X11 support on macOS (the latter case is probably much rarer though)
Once explorer.exe loads along with the prefix initialization, the driver variable probably has no effect (so there shouldn't be weird issues like loading X11 driver after winewayland is driving the Wine prefix); I haven't tested that theory yet though
On Mon Aug 19 12:03:23 2024 +0000, Aida Jonikienė wrote:
This is intended as a quicker and less permanent way (registry is relatively permanent) to test new graphics drivers (like winewayland) or the X11 support on macOS (the latter case is probably much rarer though) Once explorer.exe loads along with the prefix initialization, the driver variable probably has no effect (so there shouldn't be weird issues like loading X11 driver after winewayland is driving the Wine prefix); I haven't tested that theory yet though
For testing you can simply set/unset DISPLAY, there's no need for a separate variable.
For testing you can simply set/unset DISPLAY
That won't work in vanilla Wine unless !5583 is merged
On Mon Aug 19 12:16:37 2024 +0000, Aida Jonikienė wrote:
For testing you can simply set/unset DISPLAY
That won't work in vanilla Wine (with a clean prefix) unless !5583 is merged
Of course you have to set the registry key once.
Of course you have to set the registry key once.
And this change removes that permanent registry value requirement
On Wed Aug 21 08:17:12 2024 +0000, Aida Jonikienė wrote:
Of course you have to set the registry key once.
And this change removes that permanent registry value requirement
Having to add a registry key manually without X11 is really cumbersome, because `wine regedit` doesn't work so the user has to resort to `wine reg` which isn't exactly a pleasant tool to use. So this WINE_VIDEO_DRIVER variable is pretty much needed.
On Thu Aug 22 09:11:43 2024 +0000, Manuel Alfayate wrote:
Having to add a registry key manually without X11 is really cumbersome, because `wine regedit` doesn't work so the user has to resort to `wine reg` which isn't exactly a pleasant tool to use. So this WINE_VIDEO_DRIVER variable is pretty much needed.
The wayland driver will be added to the defaults once it's ready for general use.
!5583 was merged, closing.
This merge request was closed by Alexandre Julliard.