Avoid double sleep with the fps cap (#521)

This commit is contained in:
Michał Lewandowski
2025-06-14 15:36:03 +02:00
committed by GitHub
parent bd851e8b03
commit bb9ec0a469
+9 -5
View File
@@ -202,13 +202,17 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGISwapChain4::Present(UINT SyncInterval, UIN
HRESULT result;
if (!(Flags & DXGI_PRESENT_TEST || Flags & DXGI_PRESENT_RESTART) && RenderTrig != nullptr)
{
result = RenderTrig(m_pReal, SyncInterval, Flags, nullptr, Device, Handle, UWP);
else
result = m_pReal->Present(SyncInterval, Flags);
// When Reflex can't be used to limit, sleep in present
if (!State::Instance().reflexLimitsFps)
FrameLimit::sleep();
// When Reflex can't be used to limit, sleep in present
if (!State::Instance().reflexLimitsFps)
FrameLimit::sleep();
}
else
{
result = m_pReal->Present(SyncInterval, Flags);
}
return result;
}