15#include <vsg/io/stream.h>
16#include <vsg/state/DescriptorSet.h>
22 class VSG_DECLSPEC DescriptorPool :
public Inherit<Object, DescriptorPool>
25 DescriptorPool(
Device* device, uint32_t in_maxSets,
const DescriptorPoolSizes& in_descriptorPoolSizes);
27 operator VkDescriptorPool()
const {
return _descriptorPool; }
28 VkDescriptorPool vk()
const {
return _descriptorPool; }
30 Device* getDevice() {
return _device; }
31 const Device* getDevice()
const {
return _device; }
40 bool available(uint32_t& numSets, DescriptorPoolSizes& descriptorPoolSizes)
const;
43 bool used(uint32_t& numSets, DescriptorPoolSizes& usedDescriptorPoolSizes)
const;
48 const uint32_t maxSets = 0;
49 const DescriptorPoolSizes descriptorPoolSizes;
57 virtual ~DescriptorPool();
59 VkDescriptorPool _descriptorPool;
62 uint32_t _availableDescriptorSet;
63 DescriptorPoolSizes _availableDescriptorPoolSizes;
65 std::list<ref_ptr<DescriptorSet::Implementation>> _recyclingList;
DescriptorPool encapsulates management of VkDescriptorPool.
Definition DescriptorPool.h:23
ref_ptr< DescriptorSet::Implementation > allocateDescriptorSet(DescriptorSetLayout *descriptorSetLayout)
allocate or reuse available DescriptorSet::Implementation - called automatically when compiling Descr...
bool available(uint32_t &numSets, DescriptorPoolSizes &descriptorPoolSizes) const
get the stats of the available DescriptorSets/Descriptors
void freeDescriptorSet(ref_ptr< DescriptorSet::Implementation > dsi)
free DescriptorSet::Implementation for reuse - called automatically by destruction of DescriptorSet o...
void report(std::ostream &out, indentation indent={}) const
write the internal details to stream.
bool used(uint32_t &numSets, DescriptorPoolSizes &usedDescriptorPoolSizes) const
compute the number of sets and descriptors used.
std::mutex mutex
Definition DescriptorPool.h:54
DescriptorSetLayout encapsulates VkDescriptorSetLayout and VkDescriptorSetLayoutCreateInfo settings u...
Definition DescriptorSetLayout.h:28
Device encapsulates VkDevice, a logical handle to the PhysicalDevice with capabilities specified duri...
Definition Device.h:39
helper class for inserting indentation into streams useful for formatting output.
Definition stream.h:38