diff options
| author | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2026-02-13 18:21:04 +1100 |
|---|---|---|
| committer | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2026-02-13 18:21:04 +1100 |
| commit | 8f4501215c0dbbbde59da2d015fdec3dbe5131bc (patch) | |
| tree | ac7e4b58309adb26e621c776f97fa8f08e608f04 /src/timestamp_pool.cc | |
| parent | 76f3ef1d7c2b4393a8e8b402deb924e606448d27 (diff) | |
add working frame tracking and commit before i break everything
Diffstat (limited to 'src/timestamp_pool.cc')
| -rw-r--r-- | src/timestamp_pool.cc | 12 |
1 files changed, 6 insertions, 6 deletions
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::Handle> TimestampPool::acquire() { - const auto& vacant_iter = [this]() -> auto { +std::shared_ptr<TimestampPool::Handle> 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::Handle> TimestampPool::acquire() { const auto block_index = static_cast<std::size_t>( std::distance(std::begin(this->blocks), vacant_iter)); - return std::make_unique<Handle>(available_indices, block_index, query_pool, + return std::make_shared<Handle>(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() { |
