From 89f4c0f59a90b1a4447d171bd09235126561af91 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Tue, 31 Mar 2026 00:05:03 +1100 Subject: Small Handle refactor --- src/timestamp_pool.cc | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/timestamp_pool.cc') diff --git a/src/timestamp_pool.cc b/src/timestamp_pool.cc index 19a9560..a618cfb 100644 --- a/src/timestamp_pool.cc +++ b/src/timestamp_pool.cc @@ -154,14 +154,14 @@ void TimestampPool::do_reaper(const std::stop_token stoken) { } } -void TimestampPool::Handle::setup_command_buffers( - const Handle& tail, const QueueContext& queue_context) const { +void TimestampPool::Handle::write_command( + const VkPipelineStageFlagBits2& bit) const { const auto cbbi = VkCommandBufferBeginInfo{ .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, }; - const auto& device_context = queue_context.device; + const auto& device_context = this->timestamp_pool.queue_context.device; const auto& vtable = device_context.vtable; vtable.ResetQueryPoolEXT(device_context.device, this->query_pool, @@ -175,18 +175,6 @@ void TimestampPool::Handle::setup_command_buffers( this->query_pool, static_cast(this->query_index)); THROW_NOT_VKSUCCESS(vtable.EndCommandBuffer(this->command_buffer)); - - vtable.ResetQueryPoolEXT(device_context.device, tail.query_pool, - static_cast(tail.query_index), 1); - - THROW_NOT_VKSUCCESS(vtable.ResetCommandBuffer(tail.command_buffer, 0)); - THROW_NOT_VKSUCCESS(vtable.BeginCommandBuffer(tail.command_buffer, &cbbi)); - - vtable.CmdWriteTimestamp2KHR( - tail.command_buffer, VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT, - tail.query_pool, static_cast(tail.query_index)); - - THROW_NOT_VKSUCCESS(vtable.EndCommandBuffer(tail.command_buffer)); } struct QueryResult { -- cgit v1.2.3