From 4ab8c7b97ea513e209705907afce9852934a7d86 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Thu, 26 Mar 2026 19:50:19 +1100 Subject: Implement QueueNotifyOutOfBandNV, SetLatencySleepModeNV - also some bookkeeping --- src/device_context.hh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/device_context.hh') diff --git a/src/device_context.hh b/src/device_context.hh index c76f376..6b5f000 100644 --- a/src/device_context.hh +++ b/src/device_context.hh @@ -28,6 +28,13 @@ struct DeviceContext final : public Context { const VkDevice device; const VkuDeviceDispatchTable vtable; + // Tiny struct to represent any swapchain's low latency state. + struct SwapchainInfo { + std::chrono::milliseconds present_delay = std::chrono::milliseconds{0}; + bool was_low_latency_requested = false; + }; + std::unordered_map swapchain_infos{}; + std::unordered_map> queues; struct Clock { @@ -58,15 +65,6 @@ struct DeviceContext final : public Context { }; std::unique_ptr clock; - std::uint32_t antilag_fps = 0; // TODO - VkAntiLagModeAMD antilag_mode = VK_ANTI_LAG_MODE_DRIVER_CONTROL_AMD; - - // The queue used in the last present. - std::shared_ptr present_queue; - - private: - void sleep_in_input(); - public: DeviceContext(InstanceContext& parent_instance, PhysicalDeviceContext& parent_physical, @@ -75,9 +73,13 @@ struct DeviceContext final : public Context { virtual ~DeviceContext(); public: - void notify_antilag_update(const VkAntiLagDataAMD& data); + void sleep_in_input(); - void notify_queue_present(const QueueContext& queue); + // Updates the settings associated with that swapchain. If none is provided + // all swapchains are set to this value. + void update_swapchain_infos(const std::optional target, + const std::chrono::milliseconds& present_delay, + const bool was_low_latency_requested); }; }; // namespace low_latency -- cgit v1.2.3