#ifndef VULKAN_SHADER_MODULE_HPP_
#define VULKAN_SHADER_MODULE_HPP_

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

namespace Vk
{
    class ShaderModule
    {
    private:
        VkShaderModule m_shaderModule;
        std::shared_ptr<Vk::Device> m_device;
    
    public:
        /**
         * @brief Construct a shader module.
         * 
         * @param device The device on which to create this shader module.
         * @param bytecode The SPIR-V bytecode.
         * @param bytecodeSize The size of the bytecode.
         */
        ShaderModule(std::shared_ptr<Device> device, const uint32_t *bytecode, size_t bytecodeSize);
        ShaderModule(const ShaderModule &) = delete;
        ~ShaderModule();

        /**
         * @brief Get the wrapped shader module.
         */
        VkShaderModule inner();

        /**
         * @brief Create all the shader modules.
         */
        static void createAll(std::shared_ptr<Vk::Device> device);

        #define DECL_SHADER_MODULE(name) static std::unique_ptr<ShaderModule> name
        #include <Vk/ShaderModule/ShaderModuleList.hpp>
    };
}

#endif