|
bool | addShader (ShaderStage shaderStage, const std::filesystem::path &shaderPath) |
|
const Shader & | getShader (ShaderStage shaderStage) const |
|
bool | existsShader (ShaderStage shaderStage) const |
|
const std::vector< VertexAttachment > & | getVertexAttachments () const |
|
size_t | getPushConstantSize () const |
|
const std::unordered_map< uint32_t, std::unordered_map< uint32_t, DescriptorBinding > > & | getReflectedDescriptors () const |
|
|
std::unordered_map< ShaderStage, Shader > | m_Shaders |
|
std::vector< VertexAttachment > | m_VertexAttachments |
|
std::unordered_map< uint32_t, std::unordered_map< uint32_t, DescriptorBinding > > | m_DescriptorSets |
|
size_t | m_pushConstantSize = 0 |
|
◆ addShader()
bool vkcv::ShaderProgram::addShader |
( |
ShaderStage |
shaderStage, |
|
|
const std::filesystem::path & |
shaderPath |
|
) |
| |
Adds a shader into the shader program. The shader is only added if the shader program does not contain the particular shader stage already. Contains: (1) reading of the code, (2) creation of a shader module, (3) creation of a shader stage, (4) adding to the shader stage list, (5) destroying of the shader module
- Parameters
-
[in] | flag | that signals the respective shaderStage (e.g. VK_SHADER_STAGE_VERTEX_BIT) |
[in] | relative | path to the shader code (e.g. "../../../../../shaders/vert.spv") |
◆ getReflectedDescriptors()
const std::unordered_map< uint32_t, DescriptorBindings > & vkcv::ShaderProgram::getReflectedDescriptors |
( |
| ) |
const |
Returns the reflected descriptor sets/layouts/bindings in a map of maps. First uint32_t serves as descriptor SET id. Second uint32_t serves as the descriptor set's BINDING id.
- Returns
◆ getShader()
const Shader & vkcv::ShaderProgram::getShader |
( |
ShaderStage |
shaderStage | ) |
const |
Returns the shader program's shader of the specified shader. Needed for the transfer to the pipeline.
- Returns
- Shader object consisting of buffer with shader code and shader stage enum
◆ reflectShader()
void vkcv::ShaderProgram::reflectShader |
( |
ShaderStage |
shaderStage | ) |
|
|
private |
Called after successfully adding a shader to the program. Fills vertex input attachments and descriptor sets (if present).
- Parameters
-
shaderStage | the stage to reflect data from |
The documentation for this class was generated from the following files: