doitsujin / dxvk

Vulkan-based implementation of D3D8, 9, 10 and 11 for Linux / Wine
zlib License
13.43k stars 868 forks source link

DXVK makes game go black for ~5 seconds upon Alt+Tabbing out and back into said game #3792

Closed Aikerin closed 10 months ago

Aikerin commented 10 months ago

As a Windows user, I know this program is not made for me, but this issue is very interesting.

I recently just upgraded my GPU from a GTX 1050Ti to an RTX 4060, and this issue only started appearing. Back on my 1050Ti, I could use DXVK no problem - in borderless windowed mode, I could click off the game and it would work as usual, and clicking back into it made it turn black for not even a second. After upgrading, clicking off makes the program DXVK is attached to go black for ~2 seconds clicking off and ~4 seconds clicking back on - and these times are pretty consistent. I've also noticed that startup time on the newest version is much slower than version 2.2. I'm not certain what could be causing this, as I just used DDU to completely wipe my NVIDIA drivers and reinstalled them myself afterwards. Downgrading to DXVK 2.2 also has the same issue despite working fine on my old GPU.

Software information

Persona 5 Royal, Sonic Frontiers, GTA San Andreas, etc. 1920x1080, V-Sync On, 60Hz Monitors, High/Ultra Settings in any game

System information

I'm uncertain which files are the log files - all I see are [game]_d3d11.dll and [game]_dxgi.dll.

If those happen to be correct, please let me know and I'll add them here! I'm hoping there's a way I can get this issue resolved, as I'm going back to college in a few days and would like to enjoy my games with DXVK as much as possible before I leave! I tried finding other posts about this but I wound up finding nothing, so I had to resort to making an Issue here.

I apologize for any inconvenience this Issue causes.

ryao commented 10 months ago

I suggest contacting Nvidia regarding this issue. It could be a driver bug.

K0bin commented 10 months ago

Sounds like it's mode-switching now.

Either way, this probably comes down to implementation details of the Windows compositor and Nvidia display driver. So firmly outside of our control.

doitsujin commented 10 months ago

Yeah, mode switching. Vulkan drivers on Windows will generally do this by default whenever a window covers the enitre screen since it's supposedly faster, and we're not trying to stop them unless the game explicitly forbids mode switches via some swap chain parameters. (and even then, no guarantee that this is actually respected)

HalalaiMircea commented 7 months ago

Sorry for necroing, i cannot find any other similar post. Found this on a couple of DXVK-wrapped games on Windows, is there any followup, or post on Nvidia forums...anything?

K0bin commented 7 months ago

Nope.

Proper mode-switched fullscreen supposedly has lower latency and better frame pacing, that's why the Nvidia driver applies this automatically when there's a window covering the entire screen. DXVK doesn't tell the driver to do that and I'm not aware of any clean way to prevent it.

HalalaiMircea commented 7 months ago

I tested some native Vulkan games on windows (Quake 2 remaster, RPCS3) and they don't exhibit the mode-switch. Do you think the Nvidia driver has a special handling of DXVK wrappers?

K0bin commented 7 months ago

That's possible but it's also possible that it's the exact things that DXVK does with the window that triggers it. Either way, it's undocumented as far as I know.

Windows is not the target platform for DXVK anyway.