diff --git a/OptiScaler/low_latency/input/input_common.cpp b/OptiScaler/low_latency/input/input_common.cpp index 194b74d2..8e32b258 100644 --- a/OptiScaler/low_latency/input/input_common.cpp +++ b/OptiScaler/low_latency/input/input_common.cpp @@ -1284,6 +1284,7 @@ void InputCommon::xefg_marker(void* xellContext, uint32_t frame_id, uint32_t mar } auto index = marker - 80860000; + xefg_marker_present = present_count + 1; if (!seen[index].exchange(true)) LOG_INFO("XeFG sends XeLL marker {} ({}), frame id {}", marker, magic_enum::enum_name(type), frame_id); @@ -1395,8 +1396,12 @@ void InputCommon::update() bool multiFrame = state.dlssgLastSetMode == sl::DLSSGMode::eDynamic || (state.dlssgDetectedInterpolationCount > 1 && activeOutput != LowLatencyMode::AntiLag2); + // Another XeFG behind DLSSG (DLSS Enabler's) knows its frames too, turning XeLL off under it hangs the GPU + auto lastMarker = xefg_marker_present.load(); + bool otherXefg = lastMarker != 0 && present_count + 1 - lastMarker < 20; + if (!std::exchange(lastMultiFrame, multiFrame) && multiFrame && activeOutput != LowLatencyMode::Reflex && - activeOutput != LowLatencyMode::FpsLimiter && !xefgPaced && + activeOutput != LowLatencyMode::FpsLimiter && !xefgPaced && !otherXefg && Config::Instance()->FN_ForceReflex.value_or_default() != ForceReflex::ForceEnable) { LOG_INFO("Multi frame generation, disabling {}", magic_enum::enum_name(activeOutput)); diff --git a/OptiScaler/low_latency/input/input_common.h b/OptiScaler/low_latency/input/input_common.h index 4a9e4268..06326a95 100644 --- a/OptiScaler/low_latency/input/input_common.h +++ b/OptiScaler/low_latency/input/input_common.h @@ -82,6 +82,8 @@ class InputCommon // it last marked inline static std::atomic xefg_present_queue = nullptr; inline static std::atomic_uint64_t xefg_frame_id = 0; + // The present any XeFG (also one OptiScaler doesn't own) last sent its XeLL markers on, 0 = never + inline static std::atomic_uint64_t xefg_marker_present = 0; // Time the output's last sleep took, for XeFG's Dynamic MFG (the frame time it doesn't need) inline static std::atomic last_sleep_ms = 0.0;