From 007cedaeda57df63d251b9cd51ed7ec3bd0a7f5c Mon Sep 17 00:00:00 2001 From: FakeMichau <49685661+FakeMichau@users.noreply.github.com> Date: Sat, 14 Jun 2025 15:24:50 +0200 Subject: [PATCH] Allow AL Vk to switch to using OOB present That's hopeful thinking if I'm being honest because AL VK doesn't like DLSSG either way --- .../low_latency_tech/ll_antilag_vk.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/OptiScaler/nvapi/fakenvapi/low_latency_tech/ll_antilag_vk.cpp b/OptiScaler/nvapi/fakenvapi/low_latency_tech/ll_antilag_vk.cpp index 7c607bfa..99cc1266 100644 --- a/OptiScaler/nvapi/fakenvapi/low_latency_tech/ll_antilag_vk.cpp +++ b/OptiScaler/nvapi/fakenvapi/low_latency_tech/ll_antilag_vk.cpp @@ -31,6 +31,22 @@ void AntiLagVk::sleep() { void AntiLagVk::set_marker(IUnknown* pDevice, MarkerParams* marker_params) { auto mode = is_enabled() ? VK_ANTI_LAG_MODE_ON_AMD : VK_ANTI_LAG_MODE_OFF_AMD; + + static size_t call_count = 0; + static size_t last_oob_present = 0; + static bool using_oob_present = false; + constexpr size_t allowed_gap = 10; + + call_count++; + + if (marker_params->marker_type == MarkerType::OUT_OF_BAND_PRESENT_START) { + last_oob_present = call_count; + if (!using_oob_present) + using_oob_present = true; + } + + if (using_oob_present && call_count - last_oob_present > allowed_gap) + using_oob_present = false; if (marker_params->marker_type == MarkerType::SIMULATION_START) { @@ -54,7 +70,8 @@ void AntiLagVk::set_marker(IUnknown* pDevice, MarkerParams* marker_params) { } } - if (marker_params->marker_type == MarkerType::PRESENT_START) + if ((marker_params->marker_type == MarkerType::PRESENT_START && !using_oob_present) || + marker_params->marker_type == MarkerType::OUT_OF_BAND_PRESENT_START) { // Before calling vkQueuePresentKHR VkAntiLagPresentationInfoAMD presentInfo = {};