1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 19:24:12 +01:00

[dxgi] GetDisplayModeList: Do not report modes as stretched

This is more in line with what Windows does. Games should now be
able to list more than just the monitor's maximum resolution again.
This commit is contained in:
Philip Rebohle 2018-04-18 15:03:12 +02:00
parent 05a96e96bb
commit 01061e43aa
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -183,8 +183,6 @@ namespace dxvk {
uint32_t srcModeId = 0;
uint32_t dstModeId = 0;
const bool includeStretchedModes = (Flags & DXGI_ENUM_MODES_SCALING);
while (::EnumDisplaySettingsW(monInfo.szDevice, srcModeId++, &devMode)) {
// Skip interlaced modes altogether
if (devMode.dmDisplayFlags & DM_INTERLACED)
@ -194,13 +192,6 @@ namespace dxvk {
if (devMode.dmBitsPerPel != GetFormatBpp(EnumFormat))
continue;
// Skip stretched modes unless they are requested
const bool isStretched = devMode.dmPelsWidth != UINT(monInfo.rcMonitor.right - monInfo.rcMonitor.left)
|| devMode.dmPelsHeight != UINT(monInfo.rcMonitor.bottom - monInfo.rcMonitor.top);
if (isStretched && !includeStretchedModes)
continue;
// Write back display mode
if (pDesc != nullptr) {
if (dstModeId >= *pNumModes)
@ -212,9 +203,7 @@ namespace dxvk {
mode.RefreshRate = { devMode.dmDisplayFrequency, 1 };
mode.Format = EnumFormat;
mode.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE;
mode.Scaling = isStretched
? DXGI_MODE_SCALING_STRETCHED
: DXGI_MODE_SCALING_CENTERED;
mode.Scaling = DXGI_MODE_SCALING_CENTERED;
pDesc[dstModeId] = mode;
}