diff --git a/Common/GPU/Vulkan/VulkanMemory.h b/Common/GPU/Vulkan/VulkanMemory.h index 0f25e4eb7a..edf5afc8aa 100644 --- a/Common/GPU/Vulkan/VulkanMemory.h +++ b/Common/GPU/Vulkan/VulkanMemory.h @@ -137,16 +137,20 @@ private: VkBufferUsageFlags usage_; }; +// Only appropriate for use in a per-frame pool. class VulkanDescSetPool { public: VulkanDescSetPool(const char *tag, bool grow) : tag_(tag), grow_(grow) { } ~VulkanDescSetPool(); + // Must call this before use: defines how to clear cache of ANY returned values from Allocate(). void Setup(const std::function &clear) { clear_ = clear; } void Create(VulkanContext *vulkan, const VkDescriptorPoolCreateInfo &info, const std::vector &sizes); + // Allocate a new set, which may resize and empty the current sets. + // Use only for the current frame, unless in a cache cleared by clear_. VkDescriptorSet Allocate(int n, const VkDescriptorSetLayout *layouts); void Reset(); void Destroy();