From bd7d2aac71eca32f346ceea88e4b34bd7151d907 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 7 Oct 2022 13:25:26 +0200 Subject: [PATCH] [dxgi] Get rid of NotifyModeChange method Was only used for the FPS limiter. --- src/d3d11/d3d11_swapchain.cpp | 13 ------------- src/d3d11/d3d11_swapchain.h | 6 ------ src/dxgi/dxgi_interfaces.h | 4 ---- src/dxgi/dxgi_swapchain.cpp | 29 +---------------------------- src/dxgi/dxgi_swapchain.h | 4 ---- 5 files changed, 1 insertion(+), 55 deletions(-) diff --git a/src/d3d11/d3d11_swapchain.cpp b/src/d3d11/d3d11_swapchain.cpp index cc128411b..4a7dad00d 100644 --- a/src/d3d11/d3d11_swapchain.cpp +++ b/src/d3d11/d3d11_swapchain.cpp @@ -255,19 +255,6 @@ namespace dxvk { } - void STDMETHODCALLTYPE D3D11SwapChain::NotifyModeChange( - BOOL Windowed, - const DXGI_MODE_DESC* pDisplayMode) { - if (Windowed || !pDisplayMode) { - // Display modes aren't meaningful in windowed mode - m_displayRefreshRate = 0.0; - } else { - DXGI_RATIONAL rate = pDisplayMode->RefreshRate; - m_displayRefreshRate = double(rate.Numerator) / double(rate.Denominator); - } - } - - HRESULT D3D11SwapChain::PresentImage(UINT SyncInterval) { Com deviceContext = nullptr; m_parent->GetImmediateContext(&deviceContext); diff --git a/src/d3d11/d3d11_swapchain.h b/src/d3d11/d3d11_swapchain.h index 8a006a153..29f9b9a70 100644 --- a/src/d3d11/d3d11_swapchain.h +++ b/src/d3d11/d3d11_swapchain.h @@ -69,10 +69,6 @@ namespace dxvk { UINT PresentFlags, const DXGI_PRESENT_PARAMETERS* pPresentParameters); - void STDMETHODCALLTYPE NotifyModeChange( - BOOL Windowed, - const DXGI_MODE_DESC* pDisplayMode); - private: enum BindingIds : uint32_t { @@ -114,8 +110,6 @@ namespace dxvk { bool m_dirty = true; bool m_vsync = true; - double m_displayRefreshRate = 0.0; - HRESULT PresentImage(UINT SyncInterval); void SubmitPresent( diff --git a/src/dxgi/dxgi_interfaces.h b/src/dxgi/dxgi_interfaces.h index fc94dd858..10196f253 100644 --- a/src/dxgi/dxgi_interfaces.h +++ b/src/dxgi/dxgi_interfaces.h @@ -78,10 +78,6 @@ IDXGIVkSwapChain : public IUnknown { UINT SyncInterval, UINT PresentFlags, const DXGI_PRESENT_PARAMETERS* pPresentParameters) = 0; - - virtual void STDMETHODCALLTYPE NotifyModeChange( - BOOL Windowed, - const DXGI_MODE_DESC* pDisplayMode) = 0; }; diff --git a/src/dxgi/dxgi_swapchain.cpp b/src/dxgi/dxgi_swapchain.cpp index 3ebf48346..f48a282c1 100644 --- a/src/dxgi/dxgi_swapchain.cpp +++ b/src/dxgi/dxgi_swapchain.cpp @@ -407,10 +407,8 @@ namespace dxvk { } // If the swap chain allows it, change the display mode - if (m_desc.Flags & DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH) { + if (m_desc.Flags & DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH) ChangeDisplayMode(output.ptr(), &newDisplayMode); - NotifyModeChange(m_monitor, FALSE); - } wsi::updateFullscreenWindow(m_monitor, m_window, false); } @@ -649,7 +647,6 @@ namespace dxvk { ReleaseMonitorData(); } - NotifyModeChange(m_monitor, FALSE); return S_OK; } @@ -670,8 +667,6 @@ namespace dxvk { } // Restore internal state - HMONITOR monitor = m_monitor; - m_descFs.Windowed = TRUE; m_target = nullptr; m_monitor = wsi::getWindowMonitor(m_window); @@ -684,7 +679,6 @@ namespace dxvk { return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE; } - NotifyModeChange(monitor, TRUE); return S_OK; } @@ -802,25 +796,4 @@ namespace dxvk { m_monitorInfo->ReleaseMonitorData(); } - - void DxgiSwapChain::NotifyModeChange( - HMONITOR hMonitor, - BOOL Windowed) { - wsi::WsiMode mode = { }; - - if (wsi::getCurrentDisplayMode(hMonitor, &mode)) { - DXGI_MODE_DESC displayMode = { }; - displayMode.Width = mode.width; - displayMode.Height = mode.height; - displayMode.RefreshRate = { mode.refreshRate.numerator, mode.refreshRate.denominator }; - displayMode.Format = m_desc.Format; - displayMode.ScanlineOrdering = m_descFs.ScanlineOrdering; - displayMode.Scaling = m_descFs.Scaling; - m_presenter->NotifyModeChange(Windowed, &displayMode); - } else { - Logger::warn("Failed to query current display mode"); - m_presenter->NotifyModeChange(Windowed, nullptr); - } - } - } diff --git a/src/dxgi/dxgi_swapchain.h b/src/dxgi/dxgi_swapchain.h index b1c38c4e5..6aaa6892c 100644 --- a/src/dxgi/dxgi_swapchain.h +++ b/src/dxgi/dxgi_swapchain.h @@ -216,10 +216,6 @@ namespace dxvk { void ReleaseMonitorData(); - void NotifyModeChange( - HMONITOR hMonitor, - BOOL Windowed); - }; }