Windows: do not run DX hook when DXGI_PRESENT_TEST is set

Present only returns the status when DXGI_PRESENT_TEST is set, no data will be renderer and displayed. We should not run the frame rate limiting logic, and NVIDIA reflex on this!
This commit is contained in:
Kawe Mazidjatari 2024-11-20 15:15:54 +01:00
parent 745024d198
commit e4dafa240e

View File

@ -92,6 +92,9 @@ static ConVar fps_max_rt_sleep_threshold("fps_max_rt_sleep_threshold", "0.016666
HRESULT __stdcall Present(IDXGISwapChain* pSwapChain, UINT nSyncInterval, UINT nFlags)
{
if (nFlags & DXGI_PRESENT_TEST)
return s_fnSwapChainPresent(pSwapChain, nSyncInterval, nFlags);
float targetFps = fps_max_rt.GetFloat();
if (targetFps > 0.0f)