From b79dc96e68848a4e313d400691bf047aa29973f6 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Mon, 16 Feb 2026 16:06:50 +1100 Subject: dont oversleep via timeline sempahore waits --- src/queue_context.hh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/queue_context.hh') diff --git a/src/queue_context.hh b/src/queue_context.hh index 6a71754..ba4708b 100644 --- a/src/queue_context.hh +++ b/src/queue_context.hh @@ -41,7 +41,10 @@ class QueueContext final : public Context { const std::shared_ptr start_handle; const std::shared_ptr end_handle; + std::uint64_t sequence; + bool end_of_frame_marker = false; + std::string debug; }; std::deque> submissions; @@ -52,6 +55,7 @@ class QueueContext final : public Context { struct Timepoint { const QueueContext& context; const std::shared_ptr handle; + std::uint64_t sequence; }; const Timepoint start; @@ -60,13 +64,12 @@ class QueueContext final : public Context { std::deque> in_flight_frames; struct Timing { - DeviceContext::Clock::time_point_t gpu_start; DeviceContext::Clock::time_point_t gpu_end; - // Distance between the last gpu_end and this one. - // So one entire go around, including all cpu and gpu. - DeviceContext::Clock::time_point_t::duration frametime; + DeviceContext::Clock::time_point_t::duration gpu_time; + + std::unique_ptr frame; }; std::deque> timings; @@ -81,18 +84,20 @@ class QueueContext final : public Context { public: void notify_submit(const VkSubmitInfo& info, + const std::uint64_t& sequence, const std::shared_ptr head_handle, const std::shared_ptr tail_handle); void notify_submit(const VkSubmitInfo2& info, + const std::uint64_t& sequence, const std::shared_ptr head_handle, const std::shared_ptr tail_handle); void notify_present(const VkPresentInfoKHR& info); public: - std::optional get_sleep_until(); + void sleep_in_present(); }; }; // namespace low_latency -- cgit v1.2.3