1 #ifndef MSP_GL_DESCRIPTORPOOL_H_
2 #define MSP_GL_DESCRIPTORPOOL_H_
6 #include <msp/core/noncopyable.h>
15 class DescriptorPool: public NonCopyable
18 static constexpr unsigned DYNAMIC_SLOT = 0x80000000U;
27 Counts(unsigned, unsigned, unsigned);
29 Counts &operator+=(const Counts &);
37 HashSlot(std::uint64_t h, unsigned s): hash(h), slot(s) { }
41 std::vector<VkDescriptorPool> pools;
42 std::vector<std::vector<VkDescriptorSet>> sets;
43 std::vector<HashSlot> slots;
44 unsigned next_slot = 0;
46 Counts increment = { 100, 500, 500 };
49 DescriptorPool(Device &);
53 void add_pool(const Counts &);
57 unsigned get_descriptor_set_slot(const PipelineState &, unsigned);
58 VkDescriptorSet get_descriptor_set(unsigned, const PipelineState &, unsigned, unsigned);