Class Shader¶
Defined in File shader.hpp
Class Documentation¶
-
class Shader¶
RAII wrapper class for VkShaderModules.
Public Functions
-
Shader(const Device &m_device, VkShaderStageFlagBits type, const std::string &name, const std::vector<char> &code, const std::string &entry_point = "main")¶
Construct a shader module from a block of SPIR-V memory.
- Parameters
device – The const reference to a device RAII wrapper instance.
type – The shader type.
name – The internal debug marker name of the VkShaderModule.
code – The memory block of the SPIR-V shader.
entry_point – The name of the entry point, “main” by default.
-
Shader(const Device &m_device, VkShaderStageFlagBits type, const std::string &name, const std::string &file_name, const std::string &entry_point = "main")¶
Construct a shader module from a SPIR-V file. This constructor loads the file content and just calls the other constructor.
- Parameters
device – The const reference to a device RAII wrapper instance.
type – The shader type.
name – The internal debug marker name of the VkShaderModule.
file_name – The name of the SPIR-V shader file to load.
entry_point – The name of the entry point, “main” by default.
-
~Shader()¶
-
inline const std::string &name() const¶
-
inline const std::string &entry_point() const¶
-
inline VkShaderStageFlagBits type() const¶
-
inline VkShaderModule module() const¶
-
Shader(const Device &m_device, VkShaderStageFlagBits type, const std::string &name, const std::vector<char> &code, const std::string &entry_point = "main")¶