From 59289c6fcd79e52a4395451f61851661c417dbb3 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Sun, 12 Apr 2026 18:45:49 +1000 Subject: LowLatency2: Check semaphore value before signalling --- src/strategies/low_latency2/swapchain_monitor.hh | 14 +++----------- 1 file changed, 3 insertions(+), 11 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 ddc25ef..5906ad1 100644 --- a/src/strategies/low_latency2/swapchain_monitor.hh +++ b/src/strategies/low_latency2/swapchain_monitor.hh @@ -4,6 +4,7 @@ #include "atomic_time_point.hh" #include "frame_span.hh" +#include "semaphore_signal.hh" #include @@ -19,18 +20,10 @@ class DeviceContext; class SwapchainMonitor final { private: - struct WakeupSemaphore { - VkSemaphore timeline_semaphore{}; - std::uint64_t value{}; - - public: - void signal(const DeviceContext& device) const; - }; - std::vector> pending_frame_spans{}; struct PendingSignal { - WakeupSemaphore wakeup_semaphore{}; + SemaphoreSignal semaphore_signal; std::vector> frame_spans{}; }; std::deque pending_signals{}; @@ -60,8 +53,7 @@ class SwapchainMonitor final { void update_params(const bool was_low_latency_requested, const std::chrono::microseconds delay); - void notify_semaphore(const VkSemaphore& timeline_semaphore, - const std::uint64_t& value); + void notify_semaphore(const SemaphoreSignal& semaphore_signal); void attach_work(std::vector> submissions); }; -- cgit v1.2.3