Conversation
Decoupling query pool resets from the profiled command buffers allows to dynamically allocate the pools inside render passes, and later suballocate and reuse them between multiple command buffers.
There was a problem hiding this comment.
🟡 Changes recommended
Repeated command-buffer execution, reset-failure handling, pending-resource cleanup, and submission synchronization contain correctness issues.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Decouples query-pool resets from profiled command buffers by issuing internal reset command buffers during queue submission.
Changes:
- Splits submission processing into batch creation, preparation, and aggregation.
- Tracks internal reset/copy resources per submit batch.
- Moves query-pool reset commands out of application command buffers.
File summaries
| File | Description |
|---|---|
profiler.h |
Updates submission-processing APIs. |
profiler.cpp |
Builds and processes per-frame submit batches. |
profiler_data_aggregator.h |
Extends submit-batch state for internal commands. |
profiler_data_aggregator.cpp |
Records, submits, and cleans up reset commands. |
profiler_command_buffer.h |
Exposes query-pool resetting. |
profiler_command_buffer.cpp |
Resets pools associated with command buffers. |
profiler_command_buffer_query_pool.h |
Declares deferred reset support. |
profiler_command_buffer_query_pool.cpp |
Moves resets from recording to submission. |
VkSynchronization2Khr_functions.cpp |
Integrates batching into KHR submission. |
VkQueue_functions.cpp |
Integrates batching into core submissions. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 5
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1451
to
+1452
| auto DeviceProfiler::GetSubmitBatchesImpl( VkQueue queue, uint32_t submitCount, const SubmitInfoT* pSubmits ) | ||
| -> DeviceProfilerSubmitBatchesPerFrame |
Comment on lines
+1525
to
+1528
| submitBatch.m_pSubmittedCommandBuffers.insert( pProfilerCommandBuffer ); | ||
| submitBatch.m_pSubmittedCommandBuffers.insert( | ||
| pSecondaryCommandBuffers.begin(), | ||
| pSecondaryCommandBuffers.end() ); |
Comment on lines
+1302
to
+1305
| if( submitBatch.m_QueryResetCommandBuffer ) | ||
| { | ||
| assert( submitBatch.m_pInternalCommandPool != nullptr ); | ||
| std::unique_lock commandPoolLock( submitBatch.m_pInternalCommandPool->GetMutex() ); |
Comment on lines
+1073
to
+1078
|
|
||
| for( ProfilerCommandBuffer* pSecondaryCommandBuffer : m_pSecondaryCommandBuffers ) | ||
| { | ||
| pSecondaryCommandBuffer->ResetQueryPools( commandBuffer ); | ||
| } | ||
| } |
Comment on lines
+339
to
+343
| bool succeeded = ResetQueryPools( submitBatch ); | ||
| if( !succeeded ) | ||
| { | ||
| submitBatch.m_pSubmittedCommandBuffers.insert( | ||
| _submit.m_pCommandBuffers.begin(), | ||
| _submit.m_pCommandBuffers.end() ); | ||
|
|
||
| // Track secondary command buffers as well. | ||
| for( const ProfilerCommandBuffer* pCommandBuffer : _submit.m_pCommandBuffers ) | ||
| { | ||
| const std::unordered_set<ProfilerCommandBuffer*>& pSecondaryCommandBuffers = | ||
| pCommandBuffer->GetSecondaryCommandBuffers(); | ||
|
|
||
| submitBatch.m_pSubmittedCommandBuffers.insert( | ||
| pSecondaryCommandBuffers.begin(), | ||
| pSecondaryCommandBuffers.end() ); | ||
| } | ||
| FreeDynamicAllocations( submitBatch ); | ||
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Decoupling query pool resets from the profiled command buffers allows to dynamically allocate the pools inside render passes, and later suballocate and reuse them between multiple command buffers.