#ifndef DEVICE_CONTEXT_HH_ #define DEVICE_CONTEXT_HH_ #include #include #include #include #include #include #include #include "context.hh" #include "device_clock.hh" #include "instance_context.hh" #include "physical_device_context.hh" #include "queue_context.hh" #include "swapchain_monitor.hh" namespace low_latency { class DeviceContext final : public Context { public: InstanceContext& instance; PhysicalDeviceContext& physical_device; // Whether or not we were asked to do NV_VK_LowLatency2 or VK_AMD_anti_lag // at the device level. const bool was_capability_requested; const VkDevice device; const VkuDeviceDispatchTable vtable; std::unique_ptr clock; std::unordered_map> queues; std::unordered_map swapchain_monitors; public: DeviceContext(InstanceContext& parent_instance, PhysicalDeviceContext& parent_physical, const VkDevice& device, const bool was_capability_requested, VkuDeviceDispatchTable&& vtable); virtual ~DeviceContext(); public: // Updates the settings associated with that swapchain. If no swapchain // target is provided all swapchains are set to this value. void update_params(const std::optional target, const std::chrono::milliseconds& present_delay, const bool was_low_latency_requested); void notify_present(const VkSwapchainKHR& swapchain, const QueueContext::submissions_t& submissions); }; }; // namespace low_latency #endif