From 21e55ae8a1b3ddd4dff6c24a57bdc7d7272fff16 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Sun, 5 Apr 2026 18:30:25 +1000 Subject: Add boilerplate for separate implementations --- src/queue_context.cc | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/queue_context.cc') 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 @@ -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(*this)) { - // Only construct a timestamp pool if we support it! - if (device.physical_device.supports_required_extensions) { - this->timestamp_pool = std::make_unique(*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(*this); + this->strategy = [&]() -> std::unique_ptr { + if (device.instance.layer.should_expose_reflex) { + return std::make_unique(*this); + } + return std::make_unique(*this); + }(); } +QueueContext::~QueueContext() { this->timestamp_pool.reset(); } + bool QueueContext::should_inject_timestamps() const { const auto& physical_device = this->device.physical_device; -- cgit v1.2.3