From 453d5b0052bd17ed74d47570ffff403ffcd9ebb3 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Wed, 8 Apr 2026 12:55:29 +1000 Subject: Fix refactor latency regression for VK_NV_LowLatency2 by checking if work has already completed --- src/strategies/low_latency2/queue_strategy.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/strategies/low_latency2/queue_strategy.cc') diff --git a/src/strategies/low_latency2/queue_strategy.cc b/src/strategies/low_latency2/queue_strategy.cc index a020c0d..e3ed808 100644 --- a/src/strategies/low_latency2/queue_strategy.cc +++ b/src/strategies/low_latency2/queue_strategy.cc @@ -29,15 +29,14 @@ static void notify_submit_impl(LowLatency2QueueStrategy& strategy, const auto [iter, inserted] = strategy.frame_spans.try_emplace(present_id); if (inserted) { iter->second = std::make_unique(std::move(handle)); + // Add our present_id to our ring tracking if it's non-zero. + if (present_id) { + strategy.stale_present_ids.push_back(present_id); + } } else { iter->second->update(std::move(handle)); } - // Add our present_id to our ring tracking if it's non-zero. - if (inserted && present_id) { - strategy.stale_present_ids.push_back(present_id); - } - // Remove stale present_id's if they weren't presented to. if (std::size(strategy.stale_present_ids) > LowLatency2QueueStrategy::MAX_TRACKED_PRESENTS) { -- cgit v1.2.3