Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions impeller/renderer/backend/vulkan/command_pool_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ void CommandPoolVK::Destroy() {
// Associates a resource with a thread and context.
using CommandPoolMap =
std::unordered_map<uint64_t, std::shared_ptr<CommandPoolVK>>;

// Lifecycle:
// 1. End of frame will reset the command pool (clearing this on a thread).
// There will still be references to the command pool from the uncompleted
// command buffers.
// 2. The last reference to the command pool wuill be destroyed from the fence
// waiter thread, which will schedule something to occur on the resource
// manager thread, which in turn will reset the command pool and make it
// available for reuse ("recycle").
static thread_local std::unique_ptr<CommandPoolMap> tls_command_pool_map;

// Map each context to a list of all thread-local command pools associated
Expand Down