#ifndef VULKAN_DESCRIPTOR_POOL_HPP_
#define VULKAN_DESCRIPTOR_POOL_HPP_

#include <Utilities/Extern.hpp>
#include <Vk/Device/Device.hpp>

namespace Vk
{
    /**
     * @brief Represents a Vulkan descriptor pool.
     */
    class DescriptorPool
    {
    private:
        std::shared_ptr<Vk::Device> m_device;
        VkDescriptorPool m_descriptorPool;
    
    public:
        /**
         * @brief Represents a descriptor pool builder.
         */
        class Builder
        {
        private:
            std::vector<VkDescriptorPoolSize> m_poolSizes;
        
        public:
            /**
             * @brief Add the specified amount of the specified type of descriptor.
             */
            Builder& addDescriptorType(VkDescriptorType type, uint32_t count);

            /**
             * @brief Build the descriptor pool.
             */
            std::shared_ptr<Vk::DescriptorPool> build(std::shared_ptr<Vk::Device> device, uint32_t maxSets);
        };

        /**
         * @brief Construct a new descriptor pool.
         * 
         * @param device The device on which to create.
         * @param descriptorType The type of descriptor.
         * @param descriptorCount The number of descriptors in each set.
         * @param maxSets The maximum number of sets.
         */
        DescriptorPool(
            std::shared_ptr<Vk::Device> device,
            VkDescriptorType descriptorType,
            uint32_t descriptorCount,
            uint32_t maxSets
        );
        DescriptorPool(
            std::shared_ptr<Vk::Device> device,
            VkDescriptorPool pool
        );
        DescriptorPool(const DescriptorPool &) = delete;
        ~DescriptorPool();

        /**
         * @brief Return the wrapped descriptor pool.
         */
        VkDescriptorPool inner();
    };
}

#endif