diff --git a/r5dev/engine/sys_dll2.cpp b/r5dev/engine/sys_dll2.cpp index a878d759..0a8317c2 100644 --- a/r5dev/engine/sys_dll2.cpp +++ b/r5dev/engine/sys_dll2.cpp @@ -17,6 +17,7 @@ #include "engine/traceinit.h" #ifndef DEDICATED #include "engine/sys_mainwind.h" +#include "materialsystem/cmaterialsystem.h" #include "windows/id3dx.h" #include "client/vengineclient_impl.h" #include "geforce/reflex.h" @@ -183,32 +184,40 @@ bool CEngineAPI::MainLoop() } #ifndef DEDICATED - if (GFX_HasPendingLowLatencyParameterUpdates()) + const MaterialAdapterInfo_t& adapterInfo = g_pMaterialAdapterMgr->GetAdapterInfo(); + + // Only run on NVIDIA display drivers; AMD and Intel are not + // supported by NVIDIA Reflex. + if (adapterInfo.m_VendorID == NVIDIA_VENDOR_ID) { - const bool bUseLowLatencyMode = gfx_nvnUseLowLatency->GetBool(); - const bool bUseLowLatencyBoost = gfx_nvnUseLowLatencyBoost->GetBool(); - - float fpsMax = fps_max_gfx->GetFloat(); - - if (fpsMax == -1.0f) + if (GFX_HasPendingLowLatencyParameterUpdates()) { - const float globalFps = fps_max->GetFloat(); + const bool bUseLowLatencyMode = gfx_nvnUseLowLatency->GetBool(); + const bool bUseLowLatencyBoost = gfx_nvnUseLowLatencyBoost->GetBool(); - // Make sure the global fps limiter is 'unlimited' - // before we let the gfx frame limiter cap it to - // the desktop's refresh rate; not adhering to - // this will result in a major performance drop. - if (globalFps == 0.0f) - fpsMax = g_pGame->GetTVRefreshRate(); - else - fpsMax = 0.0f; // Don't let NVIDIA limit the frame rate. + float fpsMax = fps_max_gfx->GetFloat(); + + if (fpsMax == -1.0f) + { + const float globalFps = fps_max->GetFloat(); + + // Make sure the global fps limiter is 'unlimited' + // before we let the gfx frame limiter cap it to + // the desktop's refresh rate; not adhering to + // this will result in a major performance drop. + if (globalFps == 0.0f) + fpsMax = g_pGame->GetTVRefreshRate(); + else + fpsMax = 0.0f; // Don't let NVIDIA limit the frame rate. + } + + GFX_UpdateLowLatencyParameters(D3D11Device(), bUseLowLatencyMode, + bUseLowLatencyBoost, false, fpsMax); } - GFX_UpdateLowLatencyParameters(D3D11Device(), bUseLowLatencyMode, - bUseLowLatencyBoost, false, fpsMax); + GFX_RunLowLatencyFrame(D3D11Device()); } - GFX_RunLowLatencyFrame(D3D11Device()); CEngineAPI::PumpMessages(); #endif // !DEDICATED