Use much simpler frames presented logic to fix Cp77 frame counter

This commit is contained in:
cdozdil
2025-11-07 02:08:42 +03:00
parent 73a2f4876f
commit d6448a7964
+6 -10
View File
@@ -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;
}