#pragma once #include "VulkanGraphicsResources.h" #include "VulkanGraphicsEnums.h" namespace Seele { namespace Vulkan { DECLARE_REF(Graphics) DECLARE_REF(DescriptorLayout) class Shader { public: Shader(PGraphics graphics, ShaderType shaderType, VkShaderStageFlags stage); virtual ~Shader(); void create(const ShaderCreateInfo& createInfo); VkShaderModule getModuleHandle() const { return module; } const char* getEntryPointName() const { //SLang renames all entry points to main, so we dont need that return "main";//entryPointName.c_str(); } Map getDescriptorLayouts(); uint32 getShaderHash() const; private: PGraphics graphics; Map descriptorSets; VkShaderModule module; ShaderType type; VkShaderStageFlags stage; std::string entryPointName; uint32 hash; }; DEFINE_REF(Shader) template class ShaderBase : public Base, public Shader { public: ShaderBase(PGraphics graphics) : Shader(graphics, shaderType, stageFlags) { } virtual ~ShaderBase() { } }; typedef ShaderBase VertexShader; typedef ShaderBase ControlShader; typedef ShaderBase EvaluationShader; typedef ShaderBase GeometryShader; typedef ShaderBase FragmentShader; typedef ShaderBase ComputeShader; DEFINE_REF(VertexShader) DEFINE_REF(ControlShader) DEFINE_REF(EvaluationShader) DEFINE_REF(GeometryShader) DEFINE_REF(FragmentShader) DEFINE_REF(ComputeShader) } // namespace Vulkan }