doitsujin / dxvk

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

Grand Theft Auto V runs at 10 FPS with vsync enabled #1314

Closed mrpippy closed 4 years ago

mrpippy commented 4 years ago

Starting with DXVK 1.5, Grand Theft Auto V's opening movie (Rockstar logo) and menus always run at 8-10 FPS. With VSync enabled, the game itself also runs at 10 FPS. With VSync disabled, the game runs normally (60-80 FPS for me). Some people have also found that the borderless window setting restores normal performance: https://github.com/ValveSoftware/Proton/issues/37#issuecomment-567450992.

I was able to bisect the problem down to commit aa40decc. I can post an apitrace tomorrow.

Software information

Grand Theft Auto V, from Steam. Build 1868, Online 1.50. DirectX 11 mode.

System information

Apitrace file(s)

Log files

doitsujin commented 4 years ago

Sounds like the game thinks it's minimized for whatever reason. Not sure if there's much I can do there. Unfortunately I can't test the game right now due to a) the launcher being constantly broken and b) not having access to my work PC at the moment.

I know that GTA V uses PRESENT_TEST before every "real" present, but that should still work just fine.

In general, Vsync-related problems are almost never DXVK bugs, but it's weird that the commit you mentioned would cause a regression like this since we only return DXGI_STATUS_OCCLUDED if there's literally no way we can present anything.

doitsujin commented 4 years ago

Can you test if this branch fixes the problem?

We should never return DXGI_STATUS_OCCLUDED to the application unless the application window is minimized, but this should fully restore the behaviour before aa40dec.

aufkrawall commented 4 years ago

I can't confirm this issue with DXVK git-master in wine-tkg (75Hz): Screenshot_20200103_183406

But the in-game vsync option is heavily bugged and may jump to half rate, which capped it to 39fps for me (something seems odd about that math), despite of forcing vsync via DXVK. I had to set it to off and restart the game to make it work.

@doitsujin The non-Steam version with just Rockstar Game Launcher should work with the corresponding community patches for wine-tkg: https://github.com/Tk-Glitch/PKGBUILDS/tree/master/community-patches/wine-tkg-git

mrpippy commented 4 years ago

Can you test if this branch fixes the problem?

We should never return DXGI_STATUS_OCCLUDED to the application unless the application window is minimized, but this should fully restore the behaviour before aa40dec.

I tried the branch, it didn't fix the issue. I tried reverting other parts of the patch though, and found that adding the PRESENT_TEST check back into DxgiSwapChain::Present1 does fix it: https://github.com/doitsujin/dxvk/commit/aa40decc23f27bcb25bd8e61a76c032fd99ada59#diff-ba6fe080f093adac8573732dd035e363

Without that, the while loop in PresentImage is regularly looping because of status == VK_NOT_READY

doitsujin commented 4 years ago

I'm not sure I understand. PresentImage is never called when PRESENT_TEST is being used.

doitsujin commented 4 years ago

Does ae01bd8 fix the problem? I don't know if the game runs into that issue but it's a genuine bug regardless.

andrew-mcmahon commented 4 years ago

I believe that fixes V-Sync for me - at least with VSync = On.
https://imgur.com/a/HikXstk

I removed the dxvk.conf workaround. I've compiled the latest and replaced the DXVK files Proton-4.21-GE-2 comes bundled with - those are found in:

/home/mwnn/.steam/steam/compatibilitytools.d/Proton-4.21-GE-2/dist/lib64/wine/dxvk/
/home/mwnn/.steam/steam/compatibilitytools.d/Proton-4.21-GE-2/dist/lib/wine/dxvk/

I don't need to apply the workaround with the dxvk.conf file any longer. 60 Hz is the max on my ASUS PB238Q.
GTA V settings.txt

Others may wish to confirm that though. It's practically miraculous what you clever lot are doing.

EDIT: This is a better proof - a one handed video on my Galaxy S5 Neo: https://drive.google.com/open?id=1-q-NCiy7FRKWZXjovef-1_zmVKRUswRS

EDIT2: Just to be thorough - VSync Half @ 30 fps: https://imgur.com/a/owsaQyq

mrpippy commented 4 years ago

Does ae01bd8 fix the problem? I don't know if the game runs into that issue but it's a genuine bug regardless.

Yep that fixes the problem for me too, thanks!