13 std::filesystem::path filename;
23 VkShaderStageFlagBits stageFlags;
28 VkSpecializationInfo* pSpecializationInfo;
37 MANDRILL_API ShaderDesc(std::filesystem::path filename, std::string entry, VkShaderStageFlagBits stageFlags,
38 VkSpecializationInfo* pSpecializationInfo =
nullptr)
39 : filename(filename), entry(entry), stageFlags(stageFlags), pSpecializationInfo(pSpecializationInfo)
51 MANDRILL_NON_COPYABLE(
Shader)
58 MANDRILL_API
Shader(ptr<Device> pDevice,
const std::vector<ShaderDesc>& desc);
68 MANDRILL_API
void reload();
74 MANDRILL_API std::vector<VkShaderModule>
getModules()
const
83 MANDRILL_API std::vector<VkPipelineShaderStageCreateInfo>
getStages()
const
89 void createModulesAndStages();
90 VkShaderModule loadModuleFromFile(
const std::filesystem::path& input);
94 std::vector<VkShaderModule> mModules;
95 std::vector<VkPipelineShaderStageCreateInfo> mStages;
97 std::vector<std::string> mEntries;
98 std::vector<std::filesystem::path> mSrcFilenames;
99 std::vector<VkShaderStageFlagBits> mStageFlags;
100 std::vector<VkSpecializationInfo*> mSpecializationInfos;
Shader class that abstracts the handling of Vulkan shaders. This class manages shader modules and hot...
Definition Shader.h:49
MANDRILL_API std::vector< VkPipelineShaderStageCreateInfo > getStages() const
Get pipeline shader stage create infos.
Definition Shader.h:83
MANDRILL_API void reload()
Reload shader code from disk and recompile it.
Definition Shader.cpp:98
MANDRILL_API std::vector< VkShaderModule > getModules() const
Get shader module handles.
Definition Shader.h:74
MANDRILL_API ~Shader()
Destructor for shader.
Definition Shader.cpp:88