From eb9719cc8b9a308654ccd2c3bce8a7047b6e2a1a Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Wed, 8 Apr 2026 00:56:40 +1000 Subject: Refactor storing submissions into FrameSpan class, reduce AntiLag thread contention --- src/strategies/low_latency2/swapchain_monitor.hh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/strategies/low_latency2/swapchain_monitor.hh') diff --git a/src/strategies/low_latency2/swapchain_monitor.hh b/src/strategies/low_latency2/swapchain_monitor.hh index 47c3a75..837f8e4 100644 --- a/src/strategies/low_latency2/swapchain_monitor.hh +++ b/src/strategies/low_latency2/swapchain_monitor.hh @@ -2,17 +2,16 @@ #ifndef SWAPCHAIN_MONITOR_HH_ #define SWAPCHAIN_MONITOR_HH_ +#include "frame_span.hh" + #include #include #include -#include #include #include #include -#include "submission.hh" - namespace low_latency { class DeviceContext; @@ -28,15 +27,15 @@ class SwapchainMonitor final { }; // An empty vector here represents our 'no work' state. - std::vector>> pending_submissions{}; + std::vector> pending_frame_spans{}; // A pairing of semaphore -> submissions. // If the Submissions completes then signal the bundled semaphore. - struct SemaphoreSubmissions { + struct SemaphoreSpans { WakeupSemaphore wakeup_semaphore{}; - std::vector>> submissions{}; + std::vector> frame_spans{}; }; - std::optional semaphore_submission{}; + std::optional semaphore_spans{}; protected: const DeviceContext& device; @@ -67,8 +66,7 @@ class SwapchainMonitor final { void notify_semaphore(const VkSemaphore& timeline_semaphore, const std::uint64_t& value); - void attach_work( - std::vector>> submissions); + void attach_work(std::vector> submissions); }; } // namespace low_latency -- cgit v1.2.3