From 8d510ff579d6f68022587735aecbc36f3390bbff Mon Sep 17 00:00:00 2001 From: cdozdil Date: Mon, 1 Dec 2025 00:15:47 +0300 Subject: [PATCH] Added AllowedFrameAhead --- OptiScaler/framegen/IFGFeature.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/OptiScaler/framegen/IFGFeature.cpp b/OptiScaler/framegen/IFGFeature.cpp index 052b21d5..6f24961e 100644 --- a/OptiScaler/framegen/IFGFeature.cpp +++ b/OptiScaler/framegen/IFGFeature.cpp @@ -20,7 +20,7 @@ UINT64 IFGFeature::StartNewFrame() { _frameCount++; - if (_lastDispatchedFrame == 0 || _frameCount - _lastDispatchedFrame > 2) + if (_lastDispatchedFrame == 0 || (_frameCount - _lastDispatchedFrame) > 2) { LOG_WARN("Frame count jumped too much! _frameCount: {}, _lastDispatchedFrame: {}", _frameCount, _lastDispatchedFrame); @@ -124,8 +124,7 @@ int IFGFeature::GetDispatchIndex(UINT64& willDispatchFrame) return -1; auto diff = _frameCount - _lastDispatchedFrame; - auto fgFrameDiff = State::Instance().FGLastFrame - _lastFGFrame; - if (diff > 2 || diff < 0 || _lastDispatchedFrame == 0 || fgFrameDiff == 0) + if (diff > Config::Instance()->FGAllowedFrameAhead.value_or_default() || diff < 0 || _lastDispatchedFrame == 0) willDispatchFrame = _frameCount; // Set dispatch frame as new one else willDispatchFrame = _lastDispatchedFrame + 1; // Render next one