aboutsummaryrefslogtreecommitdiff
path: root/src/strategies/low_latency2/swapchain_monitor.hh
diff options
context:
space:
mode:
authorNicolas James <nj3ahxac@gmail.com>2026-04-08 00:56:40 +1000
committerNicolas James <nj3ahxac@gmail.com>2026-04-08 00:56:40 +1000
commiteb9719cc8b9a308654ccd2c3bce8a7047b6e2a1a (patch)
tree5e72b419d3dc900a35921be5e551b17552251769 /src/strategies/low_latency2/swapchain_monitor.hh
parent69764a869d99e9abd0fbe10c2773d3556d7f35e8 (diff)
Refactor storing submissions into FrameSpan class, reduce AntiLag thread contention
Diffstat (limited to 'src/strategies/low_latency2/swapchain_monitor.hh')
-rw-r--r--src/strategies/low_latency2/swapchain_monitor.hh16
1 files changed, 7 insertions, 9 deletions
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 <vulkan/vulkan.h>
#include <chrono>
#include <condition_variable>
-#include <deque>
#include <memory>
#include <mutex>
#include <thread>
-#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<std::deque<std::unique_ptr<Submission>>> pending_submissions{};
+ std::vector<std::unique_ptr<FrameSpan>> 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<std::deque<std::unique_ptr<Submission>>> submissions{};
+ std::vector<std::unique_ptr<FrameSpan>> frame_spans{};
};
- std::optional<SemaphoreSubmissions> semaphore_submission{};
+ std::optional<SemaphoreSpans> 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<std::deque<std::unique_ptr<Submission>>> submissions);
+ void attach_work(std::vector<std::unique_ptr<FrameSpan>> submissions);
};
} // namespace low_latency