From eb9719cc8b9a308654ccd2c3bce8a7047b6e2a1a Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Wed, 8 Apr 2026 00:56:40 +1000 Subject: Refactor storing submissions into FrameSpan class, reduce AntiLag thread contention --- src/timestamp_pool.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/timestamp_pool.cc') diff --git a/src/timestamp_pool.cc b/src/timestamp_pool.cc index b52e8f8..afb12f7 100644 --- a/src/timestamp_pool.cc +++ b/src/timestamp_pool.cc @@ -164,7 +164,7 @@ void TimestampPool::do_reaper(const std::stop_token stoken) { // Allow more to go on the queue while we wait for it to finish. lock.unlock(); - handle_ptr->await_end_time(); + handle_ptr->await_end(); // Lock our mutex, allow the queue to use it again and delete it. lock.lock(); @@ -185,7 +185,7 @@ const VkCommandBuffer& TimestampPool::Handle::get_end_buffer() const { return command_buffers[this->query_index + 1]; } -DeviceClock::time_point_t +std::uint64_t TimestampPool::Handle::await_time_impl(const std::uint32_t offset) const { const auto& context = this->timestamp_pool.queue_context.device; @@ -201,15 +201,11 @@ TimestampPool::Handle::await_time_impl(const std::uint32_t offset) const { VK_QUERY_RESULT_WAIT_BIT)); assert(query_result[1]); - return context.clock->ticks_to_time(query_result[0]); + return query_result[0]; } -DeviceClock::time_point_t TimestampPool::Handle::await_start_time() const { - return this->await_time_impl(0); -} -DeviceClock::time_point_t TimestampPool::Handle::await_end_time() const { - return this->await_time_impl(1); -} +void TimestampPool::Handle::await_start() const { this->await_time_impl(0); } +void TimestampPool::Handle::await_end() const { this->await_time_impl(1); } TimestampPool::~TimestampPool() {} -- cgit v1.2.3