From 79c9f28f804b591a2981f9d7c224747db906b1e8 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Thu, 19 Feb 2026 17:02:40 +1100 Subject: WIP timing improvements --- src/queue_context.hh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src/queue_context.hh') diff --git a/src/queue_context.hh b/src/queue_context.hh index f8782de..0c5e51f 100644 --- a/src/queue_context.hh +++ b/src/queue_context.hh @@ -36,6 +36,8 @@ class QueueContext final : public Context { const std::shared_ptr start_handle; const std::shared_ptr end_handle; + + const DeviceContext::Clock::time_point_t enqueued_time; std::string debug; }; @@ -48,14 +50,17 @@ class QueueContext final : public Context { // present was called. // std::size(submissions) >= 1 btw struct Frame { - submission_ptr_t prev_frame_last_submit; std::deque submissions; + + // the point that control flow was returned from VkQueuePresentKHR back to the + // application. + DeviceContext::Clock::time_point_t cpu_post_present_time; }; std::deque in_flight_frames; // Completed frames. struct Timing { - DeviceContext::Clock::time_point_t::duration gputime, not_gputime; + DeviceContext::Clock::time_point_t::duration gputime, cputime; Frame frame; }; @@ -70,15 +75,15 @@ class QueueContext final : public Context { virtual ~QueueContext(); public: - void - notify_submit(const VkSubmitInfo& info, - const std::shared_ptr head_handle, - const std::shared_ptr tail_handle); - - void - notify_submit(const VkSubmitInfo2& info, - const std::shared_ptr head_handle, - const std::shared_ptr tail_handle); + void notify_submit(const VkSubmitInfo& info, + const std::shared_ptr head_handle, + const std::shared_ptr tail_handle, + const DeviceContext::Clock::time_point_t& now); + + void notify_submit(const VkSubmitInfo2& info, + const std::shared_ptr head_handle, + const std::shared_ptr tail_handle, + const DeviceContext::Clock::time_point_t& now); void notify_present(const VkPresentInfoKHR& info); -- cgit v1.2.3