From fde79e9f93bcfed26961fe4614c5a3167edc2541 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Mon, 25 Dec 2023 23:43:41 +0100 Subject: [PATCH] NVIDIA: only run latency on success Only run latency markers if NvAPI_D3D_SetSleepMode returned NVAPI_OK. --- r5dev/geforce/reflex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r5dev/geforce/reflex.cpp b/r5dev/geforce/reflex.cpp index cbb4c041..1d868d43 100644 --- a/r5dev/geforce/reflex.cpp +++ b/r5dev/geforce/reflex.cpp @@ -123,7 +123,7 @@ void GFX_SetLatencyMarker(IUnknown* const device, { Assert(device); - if (GFX_IsLowLatencySDKEnabled()) + if (GFX_ParameterUpdateWasSuccessful() && GFX_IsLowLatencySDKEnabled()) { NV_LATENCY_MARKER_PARAMS params = {}; params.version = NV_LATENCY_MARKER_PARAMS_VER1; @@ -133,6 +133,6 @@ void GFX_SetLatencyMarker(IUnknown* const device, NvAPI_D3D_SetLatencyMarker(device, ¶ms); } - // PCLStats is supported on non-NVIDIA hardware. + // PCLStats runs separately and is supported on non-NVIDIA hardware. PCLSTATS_MARKER(markerType, frameID); }