Try to improve LFX

This commit is contained in:
FakeMichau
2024-09-25 23:48:00 +02:00
parent b56aec7bbd
commit a22c48a75a
2 changed files with 11 additions and 2 deletions
+3
View File
@@ -353,6 +353,9 @@ namespace nvd {
case PRESENT_START:
lowlatency_ctx.mark_end_of_rendering();
break;
case RENDERSUBMIT_END:
lowlatency_ctx.lfx_end_frame();
break;
}
return OK();
}
+8 -2
View File
@@ -212,8 +212,6 @@ public:
// Set FPS Limiter
lfx_ctx->target_frame_time = 1000 * min_interval_us;
lfx_ctx->EndFrame(lfx_stats.frame_id, current_timestamp, &lfx_stats.latency, &lfx_stats.frame_time);
spdlog::debug("LFX latency: {}, frame_time: {}, current_timestamp: {}", lfx_stats.latency, lfx_stats.frame_time, current_timestamp);
lfx_stats.frame_id++;
lfx_stats.target = lfx_ctx->GetWaitTarget(lfx_stats.frame_id);
@@ -257,6 +255,14 @@ public:
return S_FALSE;
}
inline void lfx_end_frame() {
lfx_mutex.lock();
auto current_timestamp = get_timestamp();
lfx_ctx->EndFrame(lfx_stats.frame_id, current_timestamp, &lfx_stats.latency, &lfx_stats.frame_time);
spdlog::debug("LFX latency: {}, frame_time: {}, current_timestamp: {}", lfx_stats.latency, lfx_stats.frame_time, current_timestamp);
lfx_mutex.unlock();
}
inline void unload() {
#if _MSC_VER && _WIN64
if (al2_dx12_ctx.m_pAntiLagAPI && !AMD::AntiLag2DX12::DeInitialize(&al2_dx12_ctx))