5#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_POOL_VK_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_COMMAND_POOL_VK_H_
14#include "vulkan/vulkan_handles.hpp"
19class CommandPoolRecyclerVK;
41 std::vector<vk::UniqueCommandBuffer>&& buffers,
42 std::weak_ptr<ContextVK>& context)
44 unused_command_buffers_(
std::move(buffers)),
70 vk::UniqueCommandPool pool_ IPLR_GUARDED_BY(pool_mutex_);
71 std::vector<vk::UniqueCommandBuffer> unused_command_buffers_;
72 std::weak_ptr<ContextVK>& context_;
75 std::vector<vk::UniqueCommandBuffer> collected_buffers_ IPLR_GUARDED_BY(
104 :
public std::enable_shared_from_this<CommandPoolRecyclerVK> {
124 : context_(
std::move(context)) {}
129 std::shared_ptr<CommandPoolVK>
Get();
135 std::vector<vk::UniqueCommandBuffer>&& buffers);
141 std::weak_ptr<ContextVK> context_;
143 Mutex recycled_mutex_;
144 std::vector<RecycledData> recycled_ IPLR_GUARDED_BY(recycled_mutex_);
149 std::optional<CommandPoolRecyclerVK::RecycledData> Create();
154 std::optional<RecycledData> Reuse();
Creates and manages the lifecycle of |vk::CommandPool| objects.
void Dispose()
Clears all recycled command pools to let them be reclaimed.
std::shared_ptr< CommandPoolVK > Get()
Gets a command pool for the current thread.
CommandPoolRecyclerVK(std::weak_ptr< ContextVK > context)
Creates a recycler for the given |ContextVK|.
static void DestroyThreadLocalPools(const ContextVK *context)
Clean up resources held by all per-thread command pools associated with the given context.
void Reclaim(vk::UniqueCommandPool &&pool, std::vector< vk::UniqueCommandBuffer > &&buffers)
Returns a command pool to be reset on a background thread.
Manages the lifecycle of a single |vk::CommandPool|.
CommandPoolVK(vk::UniqueCommandPool pool, std::vector< vk::UniqueCommandBuffer > &&buffers, std::weak_ptr< ContextVK > &context)
Creates a resource that manages the life of a command pool.
void CollectCommandBuffer(vk::UniqueCommandBuffer &&buffer)
Collects the given |vk::CommandBuffer| to be retained.
void Destroy()
Delete all Vulkan objects in this command pool.
vk::UniqueCommandBuffer CreateCommandBuffer()
Creates and returns a new |vk::CommandBuffer|.
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
A unique command pool and zero or more recycled command buffers.
vk::UniqueCommandPool pool
std::vector< vk::UniqueCommandBuffer > buffers