-
Notifications
You must be signed in to change notification settings - Fork 857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[d3d9] Front/Backbuffer flipping leads to flickering in games that don't respect DISCARD SwapEffect #1368
Comments
If this is a game bug then we could add a workaround, although I'd like to understand the problem first and for that we'd need an apitrace. It's not exactly clear how to contact you, and in general we'd like apitrace links to be posted right away since having to send messages back and forth and wait for several hours or days is quite frankly just wasting everyone's time. |
Alright, sorry about that. The trace is at https://drive.google.com/file/d/1aJEv2aArCWT-1cStf5h1p3j7bmJOvqwz/view?usp=sharing . Flickering starts at frame ~370 when using dxvk. Note that I will remove the file once the issue is fixed or gets stuck since I'm not sure about the legal consequences of sharing the file. |
Fixes flickering when parts of the screen are not redrawn in a frame. Closes: doitsujin#1368
Thanks for dxvk, it's great :-) It looks like my FPS in a benchmark situation in ZUSI 3 are now better than on Windows (20 vs. 18, wined3d gets 14), but I need to double check.
The recent introduction of a front buffer in the swap chain causes some issues though. After looking into it, I believe the game actually doesn't redraw all pixels for every frame even though it uses the DISCARD SwapEffect. It apparently still expects the "current" backbuffer to be unchanged after Present(), even though that is not guaranteed on any system unless the COPY SwapEffect is used. Apparently it still works under most circumstances when setting the presentation params to windowed. (Exclusive fullscreen mode is available in the game settings, but heavily discouraged.)
Or maybe I'm reading the apitrace wrong / missing something and it actually DOES redraw everything, and dxvk just fails to do that successfully.
This results in strange flickering effects when using dxvk, but not wined3d and most Windows setups in windowed mode. Thankfully, someone posted a vid when he had the issue on Windows: https://www.youtube.com/watch?v=bm7Lk2O0Ink That issue eventually solved itself without changing anything in the game, probably an automatic Windows or driver update.
I could understand if this is a WONTFIX if the bug is in ZUSI, but since most Windows drivers seem to handle this pretty gracefully, maybe it would be possible to fix it in DXVK. I'm not really sure how that would work though. If it comes at a performance cost, then it shouldn't be a default behavior to imitate COPY SwapEffect behavior even when the application requests DISCARD.
I have verified that simply commenting out the "Rotate swap chain buffers" loop fixes the flickering. Also, released versions including v1.5.1 obviously don't flicker so you could call this a regression.
Software information
ZUSI 3 - Aerosoft Edition https://store.steampowered.com/app/1040730/ZUSI_3__Aerosoft_Edition/
Pretty much default settings, but in the wine prefix / proton "dist" directory I use dsound.dll from wine-staging, a hacked iphlpapi.dll, winetricks gdiplus and some winetricks dotnet versions and fonts to fix various game issues.
System information
Apitrace file(s)
https://drive.google.com/file/d/1aJEv2aArCWT-1cStf5h1p3j7bmJOvqwz/view?usp=sharing . Flickering starts at frame ~370 when using dxvk.
Log files
The text was updated successfully, but these errors were encountered: