aboutsummaryrefslogtreecommitdiff
path: root/src/device_context.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/device_context.hh')
-rw-r--r--src/device_context.hh24
1 files changed, 13 insertions, 11 deletions
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<VkSwapchainKHR, SwapchainInfo> swapchain_infos{};
+
std::unordered_map<VkQueue, std::shared_ptr<QueueContext>> queues;
struct Clock {
@@ -58,15 +65,6 @@ struct DeviceContext final : public Context {
};
std::unique_ptr<Clock> 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<QueueContext> 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<VkSwapchainKHR> target,
+ const std::chrono::milliseconds& present_delay,
+ const bool was_low_latency_requested);
};
}; // namespace low_latency