diff options
| author | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2026-04-05 18:30:25 +1000 |
|---|---|---|
| committer | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2026-04-05 18:30:25 +1000 |
| commit | 21e55ae8a1b3ddd4dff6c24a57bdc7d7272fff16 (patch) | |
| tree | 1b13d5ea55c38d41becd64b003cdb0645159970a /src/device_context.cc | |
| parent | 411f7acb1f92db88d2a3c92bb40da2133852b40e (diff) | |
Add boilerplate for separate implementations
Diffstat (limited to 'src/device_context.cc')
| -rw-r--r-- | src/device_context.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/device_context.cc b/src/device_context.cc index d61c1bf..a4f3a13 100644 --- a/src/device_context.cc +++ b/src/device_context.cc @@ -1,5 +1,9 @@ #include "device_context.hh" +#include "layer_context.hh" +#include "strategies/anti_lag/device_strategy.hh" +#include "strategies/low_latency2/device_strategy.hh" + #include <utility> #include <vulkan/vulkan_core.h> @@ -15,9 +19,17 @@ DeviceContext::DeviceContext(InstanceContext& parent_instance, vtable(std::move(vtable)) { // Only create our clock if we were asked to do anything. - if (this->was_capability_requested) { - this->clock = std::make_unique<DeviceClock>(*this); + if (!this->was_capability_requested) { + return; } + + this->clock = std::make_unique<DeviceClock>(*this); + this->strategy = [&]() -> std::unique_ptr<DeviceStrategy> { + if (parent_instance.layer.should_expose_reflex) { + return std::make_unique<LowLatency2DeviceStrategy>(*this); + } + return std::make_unique<AntiLagDeviceStrategy>(*this); + }(); } DeviceContext::~DeviceContext() { |
