Hide the new LFX changes behind a config setting

This commit is contained in:
FakeMichau
2024-09-28 06:15:14 +02:00
parent 99d621c352
commit 9404ba8a37
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -354,7 +354,7 @@ namespace nvd {
lowlatency_ctx.mark_end_of_rendering();
break;
case RENDERSUBMIT_END:
lowlatency_ctx.lfx_end_frame();
if (lowlatency_ctx.aggressive_lfx) lowlatency_ctx.lfx_end_frame();
break;
}
return OK();
+4
View File
@@ -119,6 +119,7 @@ public:
uint64_t calls_without_sleep = 0;
bool fg = false;
bool active = true;
bool aggressive_lfx = false;
inline void init_al2(IUnknown *pDevice) {
#if _MSC_VER && _WIN64
@@ -152,6 +153,7 @@ public:
lfx_ctx = new lfx::LatencyFleX();
force_latencyflex = get_config(L"fakenvapi", L"force_latencyflex", false);
force_reflex = (ForceReflex)get_config(L"fakenvapi", L"force_reflex", 0);
aggressive_lfx = get_config(L"fakenvapi", L"aggressive_latencyflex", false);
spdlog::info("LatencyFleX initialized");
}
@@ -214,6 +216,8 @@ public:
// Set FPS Limiter
lfx_ctx->target_frame_time = 1000 * min_interval_us;
if (!aggressive_lfx) lfx_end_frame();
lfx_mutex.lock();
lfx_stats.target = lfx_ctx->GetWaitTarget(lfx_stats.frame_id + 1);
lfx_mutex.unlock();