protonscr

Mailbox dxgi.syncMode has no effect (and a Forager problem)

dxvkclosed
doitsujin/dxvk#874 · opened 2019-01-20 by yagomont · updated 2019-12-21 · 12 comments · github
Yyagomont 2019-01-20 github

Tested on: Forager Alpha & GTA V

  • GPU: Geforce GT 1030
  • Driver: nvidia-415.27 (in xorg, WM kwin_x11)
  • Wine version: tkg-protonified 3.21
  • DXVK version: 0.95

I see no difference between dxgi.syncMode 0 or 1 with dxgi.syncInterval 1 and any value of dxgi.numBackBuffers. The framerate never climbs upwards of the refresh rate when syncInterval is 1, and syncMode is 1.

A workaround I've found was to disable kwin's fullscreen toggle so that it would magic the previously set KWIN_TRIPLE_BUFFER=1 flag into the game. There's no tearing on fullscreen, borderless, windowed, no capping to 30/60 fps, etc. It's pretty much what I was looking for, but I don't know how it works, and a general sentiment of unease over the seemingly hacky process. I expected mailbox to have the same functionality, leaving the user free to choose any window manager, but it doesn't actually do anything.

By the way, when running Forager, it should set dxgi.syncInterval to 1, else the game enforces some ridiculous number that makes it run very, very slowly. I don't know what data you need to make this into a dxvk rule, but let me know.

KK0bin maintainer 2019-01-21 github
Yyagomont 2019-01-21 github

This wiki page: https://github.com/doitsujin/dxvk/wiki/Configuration
needs to be updated. It lists dxgi.syncMode as a valid option.

Ddoitsujin maintainer 2019-01-21 github

Done.

Yyagomont 2019-01-21 github

Let's not forget about Forager! DXVK itself needs to enforce syncInterval=1 (it uses some weird other number by default, capping at 11fps). The game is unplayable otherwise, and the engine is fps-dependant, so we can't use 0 either. Looking around the code, it looks like DXVK will match for the executable name.

It's Forager.exe

Ddoitsujin maintainer 2019-01-21 github

Can you provide an apitrace? I really don't want to add a workaround without having at least an idea what the game might be doing wrong.

Yyagomont 2019-01-21 github

Here's the apitrace: https://pastebin.com/4ZKri3a9
This game, it's not setting a big number in syncInterval, it's just... turning Vsync on and off as fast as it can. What kind of behavior is that? Well, the issue is pinpointed now.

KK0bin maintainer 2019-01-21 github

That's not an apitrace. Here's how you generate one: https://github.com/doitsujin/dxvk/wiki/Common-issues#apitrace

Yyagomont 2019-01-21 github

I thought running apitrace trace wine was going to give me something, so I regarded the wine debug output as such. Perhaps I am too inept to use debugging tools.

Here's what you need: forager-debug.tar.gz

Ddoitsujin maintainer 2019-01-21 github

Your trace files are completely empty, and for future reference, trace files that are smaller than several dozen MB are most likely not useful. Please follow this step and try again if you can't get it to work normally.

Anyway, I also don't see how force-enabling Vsync for everyone in this game is a good idea. I don't know what it's trying to do but Vsync is not something that DXVK should just enable all by itself. If this turns out to be a game bug, I will not add the workaround.

Yyagomont 2019-01-21 github

Good point- I'll close this until Forager is released to evaluate how it behaves with DXVK. If the game is quickly switching vsync on and off it's on the developer. I've just confirmed it has the same behavior on the OpenGL renderer but without the massive slowdown. Why DXVK behaves differently with their methods is mysterious, but I'd rather believe it will be fixed in a later version of the game. If it doesn't, then this will be relevant to discuss later.

Ddoitsujin maintainer 2019-01-21 github

Switching Vsync on and off in Vulkan requires recreating the entire swap chain, which also recreates and re-initializes all the back buffers etc. It's a very expensive operation compared to other graphics APIs.

Yyavincl 2019-12-21 github

Solved on final release.

Nothing extracted yet.