mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-25 07:36:45 +00:00
Use much simpler frames presented logic to fix Cp77 frame counter
This commit is contained in:
@@ -611,31 +611,27 @@ sl::Result StreamlineHooks::hkslDLSSGGetState(const sl::ViewportHandle& viewport
|
||||
|
||||
auto result = o_slDLSSGGetState(viewport, state, options);
|
||||
|
||||
LOG_DEBUG("DLSSG State Status: {}, numFramesActuallyPresented: {}", magic_enum::enum_name(state.status),
|
||||
state.numFramesActuallyPresented);
|
||||
|
||||
auto& s = State::Instance();
|
||||
auto fg = s.currentFG;
|
||||
|
||||
static UINT64 lastFrameCount = 0;
|
||||
|
||||
if (fg != nullptr)
|
||||
{
|
||||
state.estimatedVRAMUsageInBytes = 256 * 1024 * 1024;
|
||||
|
||||
auto fc = s.frameCount;
|
||||
|
||||
if (lastFrameCount == 0)
|
||||
state.numFramesActuallyPresented = 1;
|
||||
if (fg->IsActive() && !fg->IsPaused())
|
||||
state.numFramesActuallyPresented = 2;
|
||||
else
|
||||
state.numFramesActuallyPresented = static_cast<uint32_t>(fc - lastFrameCount);
|
||||
|
||||
lastFrameCount = fc;
|
||||
state.numFramesActuallyPresented = 1;
|
||||
|
||||
state.lastPresentInputsProcessingCompletionFenceValue = fg->FrameCount();
|
||||
state.numFramesToGenerateMax = 1;
|
||||
}
|
||||
|
||||
LOG_DEBUG("Status: {}, numFramesActuallyPresented: {}", magic_enum::enum_name(state.status),
|
||||
state.numFramesActuallyPresented);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user