aboutsummaryrefslogtreecommitdiff
path: root/src/queue_context.cc
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2026-04-05 18:30:25 +1000
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2026-04-05 18:30:25 +1000
commit21e55ae8a1b3ddd4dff6c24a57bdc7d7272fff16 (patch)
tree1b13d5ea55c38d41becd64b003cdb0645159970a /src/queue_context.cc
parent411f7acb1f92db88d2a3c92bb40da2133852b40e (diff)
Add boilerplate for separate implementations
Diffstat (limited to 'src/queue_context.cc')
-rw-r--r--src/queue_context.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/queue_context.cc b/src/queue_context.cc
index 635b593..fce501b 100644
--- a/src/queue_context.cc
+++ b/src/queue_context.cc
@@ -1,6 +1,9 @@
#include "queue_context.hh"
#include "device_context.hh"
#include "helper.hh"
+#include "layer_context.hh"
+#include "strategies/anti_lag/queue_strategy.hh"
+#include "strategies/low_latency2/queue_strategy.hh"
#include "timestamp_pool.hh"
#include <span>
@@ -36,16 +39,22 @@ QueueContext::QueueContext(DeviceContext& device, const VkQueue& queue,
: device(device), queue(queue), queue_family_index(queue_family_index),
command_pool(std::make_unique<CommandPoolOwner>(*this)) {
- // Only construct a timestamp pool if we support it!
- if (device.physical_device.supports_required_extensions) {
- this->timestamp_pool = std::make_unique<TimestampPool>(*this);
+ // Only construct things if we actually support our operations.
+ if (!device.physical_device.supports_required_extensions) {
+ return;
}
-}
-QueueContext::~QueueContext() {
- this->timestamp_pool.reset();
+ this->timestamp_pool = std::make_unique<TimestampPool>(*this);
+ this->strategy = [&]() -> std::unique_ptr<QueueStrategy> {
+ if (device.instance.layer.should_expose_reflex) {
+ return std::make_unique<LowLatency2QueueStrategy>(*this);
+ }
+ return std::make_unique<AntiLagQueueStrategy>(*this);
+ }();
}
+QueueContext::~QueueContext() { this->timestamp_pool.reset(); }
+
bool QueueContext::should_inject_timestamps() const {
const auto& physical_device = this->device.physical_device;