1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-01 08:52:11 +01:00

[d3d9] Order modes descending by refresh rate

This commit is contained in:
WinterSnowfall 2024-10-30 23:38:11 +02:00 committed by Philip Rebohle
parent 6e43bf6d61
commit f74b2cd6c6

View File

@ -817,8 +817,9 @@ namespace dxvk {
m_modes.push_back(mode);
}
// Sort display modes by width, height and refresh rate,
// in that order. Some games rely on correct ordering.
// Sort display modes by width, height and refresh rate (descending), in that order.
// Some games rely on correct ordering, e.g. Prince of Persia (2008) expects the highest
// refresh rate to be listed first for a particular resolution.
std::sort(m_modes.begin(), m_modes.end(),
[](const D3DDISPLAYMODEEX& a, const D3DDISPLAYMODEEX& b) {
if (a.Width < b.Width) return true;
@ -827,7 +828,7 @@ namespace dxvk {
if (a.Height < b.Height) return true;
if (a.Height > b.Height) return false;
return a.RefreshRate < b.RefreshRate;
return b.RefreshRate < a.RefreshRate;
});
}