doitsujin / dxvk

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

[d3d9] Order modes descending by refresh rate #4414

Closed WinterSnowfall closed 4 weeks ago

WinterSnowfall commented 4 weeks ago

Fixes #4288. Not the shadows, those are fine. The game does however pick the first (lowest ordinal) mode for a particular resolution.

Since we were ordering them ascending by refresh rates, this has the potential to end up on 24 Hz. The game offers no means of manually selecting refresh rates. Which is why I suspect the reporter of the issue gets stuck on 50 Hz, being on AMD (see below output sample).

Behavior on native drivers is as follows:

D3DFMT_X8R8G8B8 1920 x 1080 @ 60 Hz
D3DFMT_X8R8G8B8 1920 x 1080 @ 59 Hz
D3DFMT_X8R8G8B8 1920 x 1080 @ 50 Hz
D3DFMT_X8R8G8B8 1920 x 1080 @ 120 Hz
D3DFMT_X8R8G8B8 1920 x 1080 @ 100 Hz
D3DFMT_X8R8G8B8 1920 x 1080 @ 50 Hz
D3DFMT_X8R8G8B8 1920 x 1080 @ 59 Hz
D3DFMT_X8R8G8B8 1920 x 1080 @ 60 Hz
D3DFMT_X8R8G8B8 1920 x 1080 @ 100 Hz
D3DFMT_X8R8G8B8 1920 x 1080 @ 120 Hz
D3DFMT_R5G6B5 1920 x 1080 @ 60 Hz
D3DFMT_R5G6B5 1920 x 1080 @ 48 Hz
D3DFMT_R5G6B5 1920 x 1080 @ 75 Hz
D3DFMT_R5G6B5 1920 x 1080 @ 60 Hz
D3DFMT_R5G6B5 1920 x 1080 @ 60 Hz
D3DFMT_R5G6B5 1920 x 1080 @ 50 Hz

These were collected on different systems, but you get the idea. Fun fact: Intel doesn't even order by height & width ascending, rather puts the current resolution first, and then "sticks to the plan".

I guess this would need some regression testing, but at some point we'll have to decide if we just want to YOLO it and see if any of the 99.999 d3d9 games out there are affected.

WinterSnowfall commented 4 weeks ago

Alternatively, we could simply ignore modes with refresh rates under 60 Hz. This has the benefit of potentially solving the "too many modes" situation we're hitting in some games.

WinterSnowfall commented 4 weeks ago

P.S.: This is also a proper fix for #1617, no more config file editing required to get the right refresh rate. Better late than never.