From 8f4501215c0dbbbde59da2d015fdec3dbe5131bc Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Fri, 13 Feb 2026 18:21:04 +1100 Subject: add working frame tracking and commit before i break everything --- src/timestamp_pool.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/timestamp_pool.cc') diff --git a/src/timestamp_pool.cc b/src/timestamp_pool.cc index e37dcd2..b4dc3c9 100644 --- a/src/timestamp_pool.cc +++ b/src/timestamp_pool.cc @@ -61,8 +61,8 @@ TimestampPool::TimestampPool(QueueContext& queue_context) this->blocks.emplace_back(this->allocate()); } -std::unique_ptr TimestampPool::acquire() { - const auto& vacant_iter = [this]() -> auto { +std::shared_ptr TimestampPool::acquire() { + const auto vacant_iter = [this]() -> auto { const auto it = std::ranges::find_if(this->blocks, [](const auto& block) { return std::size(*block.available_indicies); @@ -93,7 +93,7 @@ std::unique_ptr TimestampPool::acquire() { const auto block_index = static_cast( std::distance(std::begin(this->blocks), vacant_iter)); - return std::make_unique(available_indices, block_index, query_pool, + return std::make_shared(available_indices, block_index, query_pool, query_index, command_buffers); } @@ -164,15 +164,15 @@ void TimestampPool::poll() { }); }; -std::uint64_t TimestampPool::get_polled(const Handle& handle) { +std::uint64_t TimestampPool::get_polled(const Handle& handle, const bool hack) { assert(handle.block_index < std::size(this->cached_timestamps)); const auto& cached_timestamp = this->cached_timestamps[handle.block_index]; assert(cached_timestamp != nullptr); - assert(std::size(*cached_timestamp) < handle.query_index); + assert(handle.query_index < std::size(*cached_timestamp)); - return handle.query_index; + return (*cached_timestamp)[handle.query_index + hack]; } TimestampPool::~TimestampPool() { -- cgit v1.2.3