mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-05 01:24:14 +01:00
[dxgi] Get rid of NotifyModeChange method
Was only used for the FPS limiter.
This commit is contained in:
parent
038ed23a5d
commit
bd7d2aac71
@ -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<ID3D11DeviceContext> deviceContext = nullptr;
|
||||
m_parent->GetImmediateContext(&deviceContext);
|
||||
|
@ -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(
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -216,10 +216,6 @@ namespace dxvk {
|
||||
|
||||
void ReleaseMonitorData();
|
||||
|
||||
void NotifyModeChange(
|
||||
HMONITOR hMonitor,
|
||||
BOOL Windowed);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user