1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-18 04:54:15 +01:00

[dxgi] Add NotifyModeChange method to IDXGIVkSwapChain

This commit is contained in:
Philip Rebohle 2021-06-09 03:47:20 +02:00 committed by Philip Rebohle
parent 8b67ef724e
commit e281eee795
3 changed files with 24 additions and 0 deletions

View File

@ -233,6 +233,22 @@ 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);
}
if (m_presenter != nullptr)
m_presenter->setFrameRateLimiterRefreshRate(m_displayRefreshRate);
}
HRESULT D3D11SwapChain::PresentImage(UINT SyncInterval) {
Com<ID3D11DeviceContext> deviceContext = nullptr;
m_parent->GetImmediateContext(&deviceContext);

View File

@ -69,6 +69,10 @@ namespace dxvk {
UINT PresentFlags,
const DXGI_PRESENT_PARAMETERS* pPresentParameters);
void STDMETHODCALLTYPE NotifyModeChange(
BOOL Windowed,
const DXGI_MODE_DESC* pDisplayMode);
private:
enum BindingIds : uint32_t {

View File

@ -75,6 +75,10 @@ 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;
};