From 1ad777437b7a640f3479bba7aa2a2588c692db34 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 13 Feb 2024 14:40:02 -0800 Subject: [PATCH 1/4] Add lifecycle docs. --- impeller/renderer/backend/vulkan/command_pool_vk.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/impeller/renderer/backend/vulkan/command_pool_vk.cc b/impeller/renderer/backend/vulkan/command_pool_vk.cc index 7bcbb0ae1cecf..f17d1f7f7c054 100644 --- a/impeller/renderer/backend/vulkan/command_pool_vk.cc +++ b/impeller/renderer/backend/vulkan/command_pool_vk.cc @@ -158,6 +158,15 @@ void CommandPoolVK::Destroy() { // Associates a resource with a thread and context. using CommandPoolMap = std::unordered_map>; + +// 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 tls_command_pool_map; // Map each context to a list of all thread-local command pools associated From 83b81b4909c111b6449c7141c8e617cacb1051d0 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Wed, 14 Feb 2024 12:43:21 -0800 Subject: [PATCH 2/4] Update impeller/renderer/backend/vulkan/command_pool_vk.cc Co-authored-by: Jonah Williams --- impeller/renderer/backend/vulkan/command_pool_vk.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impeller/renderer/backend/vulkan/command_pool_vk.cc b/impeller/renderer/backend/vulkan/command_pool_vk.cc index f17d1f7f7c054..a941a7eafc82c 100644 --- a/impeller/renderer/backend/vulkan/command_pool_vk.cc +++ b/impeller/renderer/backend/vulkan/command_pool_vk.cc @@ -163,7 +163,7 @@ using CommandPoolMap = // 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 +// 2. The last reference to the command pool will be released 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"). From 610b43ab72e9780882c0de93c3ac99cb5621abe1 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Wed, 14 Feb 2024 12:43:27 -0800 Subject: [PATCH 3/4] Update impeller/renderer/backend/vulkan/command_pool_vk.cc Co-authored-by: Jonah Williams --- impeller/renderer/backend/vulkan/command_pool_vk.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impeller/renderer/backend/vulkan/command_pool_vk.cc b/impeller/renderer/backend/vulkan/command_pool_vk.cc index a941a7eafc82c..c0d3a10e9de78 100644 --- a/impeller/renderer/backend/vulkan/command_pool_vk.cc +++ b/impeller/renderer/backend/vulkan/command_pool_vk.cc @@ -164,7 +164,7 @@ using CommandPoolMap = // There will still be references to the command pool from the uncompleted // command buffers. // 2. The last reference to the command pool will be released from the fence -// waiter thread, which will schedule something to occur on the resource +// waiter thread, which will schedule a task 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 tls_command_pool_map; From 0826afe2f5bfc1d1443d62db2a21f08de4cd08f1 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Wed, 14 Feb 2024 14:00:00 -0800 Subject: [PATCH 4/4] Update impeller/renderer/backend/vulkan/command_pool_vk.cc Co-authored-by: gaaclarke <30870216+gaaclarke@users.noreply.github.com> --- impeller/renderer/backend/vulkan/command_pool_vk.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impeller/renderer/backend/vulkan/command_pool_vk.cc b/impeller/renderer/backend/vulkan/command_pool_vk.cc index c0d3a10e9de78..9bb3d9d898621 100644 --- a/impeller/renderer/backend/vulkan/command_pool_vk.cc +++ b/impeller/renderer/backend/vulkan/command_pool_vk.cc @@ -159,7 +159,7 @@ void CommandPoolVK::Destroy() { using CommandPoolMap = std::unordered_map>; -// Lifecycle: +// 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.