aboutsummaryrefslogtreecommitdiff
path: root/src/queue_context.hh
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2026-02-23 15:47:39 +1100
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2026-02-23 15:47:39 +1100
commit56706244924987852e5ec610941bce8258ae647b (patch)
treee9ab9cceb81b9e6c7b06e18920c3246893825f33 /src/queue_context.hh
parentf34bb0671dd196f0a9bda61d85f2fd8f190769e3 (diff)
Implement AntiLag2
Diffstat (limited to 'src/queue_context.hh')
-rw-r--r--src/queue_context.hh17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/queue_context.hh b/src/queue_context.hh
index 67b9c5d..2a3ea39 100644
--- a/src/queue_context.hh
+++ b/src/queue_context.hh
@@ -26,7 +26,7 @@ class QueueContext final : public Context {
std::unique_ptr<TimestampPool> timestamp_pool;
- private:
+ public:
static constexpr auto MAX_TRACKED_TIMINGS = 50;
// Potentially in flight queue submissions that come from this queue.
@@ -38,8 +38,6 @@ class QueueContext final : public Context {
const std::shared_ptr<TimestampPool::Handle> end_handle;
const DeviceContext::Clock::time_point_t enqueued_time;
-
- std::string debug;
};
using submission_ptr_t = std::shared_ptr<Submission>;
std::deque<submission_ptr_t> submissions;
@@ -67,7 +65,15 @@ class QueueContext final : public Context {
std::deque<std::unique_ptr<Timing>> timings;
private:
- void process_frames();
+ // Drains submissions and promotes them into a single frame object.
+ void drain_submissions_to_frame();
+
+ // Drains in flight frames and promotes them into a Timing object if they
+ // have completed.
+ void drain_frames_to_timings();
+
+ // Antilag 1 equivalent where we sleep after present to reduce queueing.
+ void sleep_in_present();
public:
QueueContext(DeviceContext& device_context, const VkQueue& queue,
@@ -86,9 +92,6 @@ class QueueContext final : public Context {
const DeviceContext::Clock::time_point_t& now);
void notify_present(const VkPresentInfoKHR& info);
-
- public:
- void sleep_in_present();
public:
bool should_inject_timestamps() const;