From 76f3ef1d7c2b4393a8e8b402deb924e606448d27 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Wed, 11 Feb 2026 23:19:15 +1100 Subject: More cleanup, fix lifetime and mutex issues --- src/timestamp_pool.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/timestamp_pool.cc') diff --git a/src/timestamp_pool.cc b/src/timestamp_pool.cc index a70c299..e37dcd2 100644 --- a/src/timestamp_pool.cc +++ b/src/timestamp_pool.cc @@ -17,6 +17,7 @@ TimestampPool::Block TimestampPool::allocate() { .queryCount = this->TIMESTAMP_QUERY_POOL_SIZE}; auto query_pool = VkQueryPool{}; + device_context.vtable.CreateQueryPool(device_context.device, &qpci, nullptr, &query_pool); return query_pool; @@ -42,6 +43,9 @@ TimestampPool::Block TimestampPool::allocate() { }; device_context.vtable.AllocateCommandBuffers( device_context.device, &cbai, std::data(command_buffers)); + std::ranges::for_each(command_buffers, [&](const auto& cb) { + device_context.sdld(device_context.device, cb); + }); return std::make_unique>(command_buffers); }(); @@ -103,7 +107,7 @@ TimestampPool::Handle::Handle( command_buffers(command_buffers) {} TimestampPool::Handle::~Handle() { - this->index_origin.insert(this->query_index); + assert(this->index_origin.insert(this->query_index).second); } void TimestampPool::Handle::setup_command_buffers( @@ -174,7 +178,6 @@ std::uint64_t TimestampPool::get_polled(const Handle& handle) { TimestampPool::~TimestampPool() { const auto& device = this->queue_context.device_context.device; const auto& vtable = this->queue_context.device_context.vtable; - for (const auto& block : this->blocks) { vtable.FreeCommandBuffers(device, this->queue_context.command_pool, std::size(*block.command_buffers), -- cgit v1.2.3