aboutsummaryrefslogtreecommitdiff
path: root/src/strategies/low_latency2/swapchain_monitor.hh
diff options
context:
space:
mode:
authorNicolas James <nj3ahxac@gmail.com>2026-04-12 18:45:49 +1000
committerNicolas James <nj3ahxac@gmail.com>2026-04-12 18:45:49 +1000
commit59289c6fcd79e52a4395451f61851661c417dbb3 (patch)
treed3cb760880805c84ed29b2d5e9fcfa69015e1625 /src/strategies/low_latency2/swapchain_monitor.hh
parent973532a7d28c2afbaaf0fe79efa9a5084d14e3aa (diff)
LowLatency2: Check semaphore value before signalling
Diffstat (limited to 'src/strategies/low_latency2/swapchain_monitor.hh')
-rw-r--r--src/strategies/low_latency2/swapchain_monitor.hh14
1 files changed, 3 insertions, 11 deletions
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 <vulkan/vulkan.h>
@@ -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<std::unique_ptr<FrameSpan>> pending_frame_spans{};
struct PendingSignal {
- WakeupSemaphore wakeup_semaphore{};
+ SemaphoreSignal semaphore_signal;
std::vector<std::unique_ptr<FrameSpan>> frame_spans{};
};
std::deque<PendingSignal> 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<std::unique_ptr<FrameSpan>> submissions);
};