5#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DESCRIPTOR_POOL_VK_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_DESCRIPTOR_POOL_VK_H_
12#include "vulkan/vulkan_handles.hpp"
34 const vk::DescriptorSetLayout& layout,
38 std::weak_ptr<const ContextVK> context_;
39 std::vector<vk::UniqueDescriptorPool> pools_;
52 :
public std::enable_shared_from_this<DescriptorPoolRecyclerVK> {
63 : context_(
std::move(context)) {}
69 vk::UniqueDescriptorPool
Get();
78 std::weak_ptr<ContextVK> context_;
80 Mutex recycled_mutex_;
81 std::vector<vk::UniqueDescriptorPool> recycled_ IPLR_GUARDED_BY(
87 vk::UniqueDescriptorPool Create();
92 std::optional<vk::UniqueDescriptorPool> Reuse();
Creates and manages the lifecycle of |vk::DescriptorPoolVK| objects.
DescriptorPoolRecyclerVK(std::weak_ptr< ContextVK > context)
Creates a recycler for the given |ContextVK|.
vk::UniqueDescriptorPool Get()
Gets a descriptor pool.
~DescriptorPoolRecyclerVK()=default
void Reclaim(vk::UniqueDescriptorPool &&pool)
Returns the descriptor pool to be reset on a background thread.
static constexpr size_t kMaxRecycledPools
The maximum number of descriptor pools this recycler will hold onto.
A per-frame descriptor pool. Descriptors from this pool don't need to be freed individually....
DescriptorPoolVK(std::weak_ptr< const ContextVK > context)
fml::StatusOr< vk::DescriptorSet > AllocateDescriptorSets(const vk::DescriptorSetLayout &layout, const ContextVK &context_vk)