diff --git a/r5dev/common/global.cpp b/r5dev/common/global.cpp index 623b31a7..508153d2 100644 --- a/r5dev/common/global.cpp +++ b/r5dev/common/global.cpp @@ -74,6 +74,7 @@ ConVar* r_visualizetraces_duration = nullptr; ConVar* gfx_nvnUseLowLatency = nullptr; ConVar* gfx_nvnUseLowLatencyBoost = nullptr; +ConVar* gfx_nvnUseMarkersToOptimize = nullptr; #endif // !DEDICATED ConVar* stream_overlay = nullptr; @@ -316,6 +317,7 @@ void ConVar_StaticInit(void) fps_max_gfx = ConVar::StaticCreate("fps_max_gfx", "0", FCVAR_RELEASE, "Frame rate limiter using NVIDIA Reflex Low Latency SDK. -1 indicates use the desktop refresh. 0 is disabled.", true, -1.f, false, 0.f, nullptr, nullptr); gfx_nvnUseLowLatency = ConVar::StaticCreate("gfx_nvnUseLowLatency" , "1", FCVAR_RELEASE | FCVAR_ARCHIVE, "Enables NVIDIA Reflex Low Latency SDK." , false, 0.f, false, 0.f, nullptr, nullptr); gfx_nvnUseLowLatencyBoost = ConVar::StaticCreate("gfx_nvnUseLowLatencyBoost", "1", FCVAR_RELEASE | FCVAR_ARCHIVE, "Enables NVIDIA Reflex Low Latency Boost.", false, 0.f, false, 0.f, nullptr, nullptr); + gfx_nvnUseMarkersToOptimize = ConVar::StaticCreate("gfx_nvnUseMarkersToOptimize", "0", FCVAR_DEVELOPMENTONLY /*!!! MAKE RELEASE ONCE IMPLEMENTED !!!*/ | FCVAR_ARCHIVE, "Enables NVIDIA Reflex Low Latency Timing.", false, 0.f, false, 0.f, nullptr, nullptr); #endif // !DEDICATED //------------------------------------------------------------------------- diff --git a/r5dev/common/global.h b/r5dev/common/global.h index 9b20f609..a9813dff 100644 --- a/r5dev/common/global.h +++ b/r5dev/common/global.h @@ -65,6 +65,7 @@ extern ConVar* r_visualizetraces_duration; extern ConVar* gfx_nvnUseLowLatency; extern ConVar* gfx_nvnUseLowLatencyBoost; +extern ConVar* gfx_nvnUseMarkersToOptimize; #endif // !DEDICATED extern ConVar* stream_overlay; diff --git a/r5dev/engine/sys_dll2.cpp b/r5dev/engine/sys_dll2.cpp index 815c8e09..881d0b44 100644 --- a/r5dev/engine/sys_dll2.cpp +++ b/r5dev/engine/sys_dll2.cpp @@ -175,6 +175,7 @@ bool CEngineAPI::MainLoop() #ifndef DEDICATED const bool bUseLowLatencyMode = gfx_nvnUseLowLatency->GetBool(); const bool bUseLowLatencyBoost = gfx_nvnUseLowLatencyBoost->GetBool(); + const bool bUseLowLatencyTiming = gfx_nvnUseMarkersToOptimize->GetBool(); float fpsMax = fps_max_gfx->GetFloat(); @@ -192,7 +193,8 @@ bool CEngineAPI::MainLoop() fpsMax = 0.0f; // Don't let NVIDIA limit the frame rate. } - GFX_RunLowLatencySDK(D3D11Device(), bUseLowLatencyMode, bUseLowLatencyBoost, fpsMax); + GFX_RunLowLatencySDK(D3D11Device(), bUseLowLatencyMode, + bUseLowLatencyBoost, bUseLowLatencyTiming, fpsMax); CEngineAPI_PumpMessages(); #endif // !DEDICATED diff --git a/r5dev/geforce/reflex.cpp b/r5dev/geforce/reflex.cpp index 8fde52d0..bea44579 100644 --- a/r5dev/geforce/reflex.cpp +++ b/r5dev/geforce/reflex.cpp @@ -9,13 +9,15 @@ //----------------------------------------------------------------------------- // Purpose: runs the low latency sdk -// Input : device - -// useLowLatencyMode - -// useLowLatencyBoost - -// maxFramesPerSecond - +// Input : *device - +// useLowLatencyMode - +// useLowLatencyBoost - +// useMarkersToOptimize - +// maxFramesPerSecond - //----------------------------------------------------------------------------- void GFX_RunLowLatencySDK(IUnknown* device, const bool useLowLatencyMode, - const bool useLowLatencyBoost, const float maxFramesPerSecond) + const bool useLowLatencyBoost, const bool useMarkersToOptimize, + const float maxFramesPerSecond) { Assert(device); Assert(IsFinite(maxFramesPerSecond)); @@ -28,7 +30,7 @@ void GFX_RunLowLatencySDK(IUnknown* device, const bool useLowLatencyMode, params.minimumIntervalUs = maxFramesPerSecond > 0 ? (NvU32)((1000.0f / maxFramesPerSecond) * 1000.0f) : 0; - params.bUseMarkersToOptimize = false; + params.bUseMarkersToOptimize = useMarkersToOptimize; NvAPI_Status status = NvAPI_D3D_SetSleepMode(device, ¶ms); diff --git a/r5dev/geforce/reflex.h b/r5dev/geforce/reflex.h index fe7b1047..0e5d0b2c 100644 --- a/r5dev/geforce/reflex.h +++ b/r5dev/geforce/reflex.h @@ -2,6 +2,7 @@ #define GFSDK_REFLEX_H void GFX_RunLowLatencySDK(IUnknown* device, const bool useLowLatencyMode, - const bool useLowLatencyBoost, const float maxFramesPerSecond); + const bool useLowLatencyBoost, const bool useMarkersToOptimize, + const float maxFramesPerSecond); #endif // GFSDK_REFLEX_H