#ifndef VULKAN_DESCRIPTOR_SET_LAYOUT_HPP_
#define VULKAN_DESCRIPTOR_SET_LAYOUT_HPP_

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

namespace Vk
{
    /**
     * @brief Represents a Vulkan descriptor set layout.
     */
    class DescriptorSetLayout
    {
    private:
        std::shared_ptr<Vk::Device> m_device;
        VkDescriptorSetLayout m_layout;
    
    public:
        /**
         * @brief Represents a descriptor set layout builder.
         */
        class Builder
        {
        private:
            std::vector<VkDescriptorSetLayoutBinding> m_bindings;
        
        public:
            /**
             * @brief Add a binding and return the builder itself.
             */
            Builder& addBinding(uint32_t binding, VkDescriptorType type, uint32_t count, VkShaderStageFlags stages);

            /**
             * @brief Build the descriptor set layout on the specified device.
             * 
             * @param device The device to create on.
             */
            std::shared_ptr<Vk::DescriptorSetLayout> build(std::shared_ptr<Vk::Device> device);
        };

        DescriptorSetLayout() = default;
        DescriptorSetLayout(const DescriptorSetLayout &) = delete;
        ~DescriptorSetLayout();

        /**
         * @brief Return the wrapped descriptor set layout.
         */
        VkDescriptorSetLayout inner();

        friend class Builder;
    };
}

#endif