#include <GREM/graphics_3d/Model3D.hpp>
◆ VertexShaderSelector
Adapter for a function that selects which vertex shader to use for a given shader configuration.
◆ FragmentShaderSelector
Adapter for a function that selects which fragment shader to use for a given shader configuration.
◆ ShaderPipelineSetBase()
| grem::graphics::Model3D::ShaderPipelineSetBase< VertexShaderConstants, VertexShaderOutputs, meta::TypeList< ExtraVertexShaderBuffers... >, FragmentShaderConstants, FragmentShaderOutputs, meta::TypeList< ExtraFragmentShaderBuffers... > >::ShaderPipelineSetBase |
( |
Device & | device, |
|
|
VertexShaderSelector | vertexShaderSelector, |
|
|
Function< VertexShaderConstants(const ShaderConfiguration &shaderConfiguration)> | vertexShaderConstantsSelector, |
|
|
FragmentShaderSelector | fragmentShaderSelector, |
|
|
Function< FragmentShaderConstants(const ShaderConfiguration &shaderConfiguration)> | fragmentShaderConstantsSelector, |
|
|
Function< ShaderPipelineOptions(const ShaderConfiguration &shaderConfiguration)> | shaderPipelineOptionsSelector ) |
|
inline |
Construct a shader pipeline set.
- Parameters
-
| device | device to create the pipeline set for. Must outlive the pipeline set. |
| vertexShaderSelector | function that chooses which vertex shader to use for each shader configuration. |
| vertexShaderConstantsSelector | function that chooses which vertex shader constants to use for each shader configuration. |
| fragmentShaderSelector | function that chooses which fragment shader to use for each shader configuration. |
| fragmentShaderConstantsSelector | function that chooses which fragment shader constants to use for each shader configuration. |
| shaderPipelineOptionsSelector | function that chooses which pipeline configuration to use for each shader configuration. |
- Warning
- The vertex shader must use the constants specified in the VertexShaderConstants template parameter.
-
The fragment shader must use the constants specified in the FragmentShaderConstants template parameter.
-
The vertex and fragment shaders must use Model3D::Mesh as their mesh type.
-
The fragment shader's input type must match the vertex shader's output type.
◆ operator()()
Get the pipeline specialization corresponding to a specific mesh configuration.
The specialization will be compiled if it has not already been requested, and then cached for future requests.
- Parameters
-
| shaderConfiguration | shader configuration to get the shader pipeline for. |
- Returns
- a read-only reference to the requested shader pipeline, valid until the next call to this function, or until the pipeline set is destroyed, whichever happens first.
- Exceptions
-
| graphics::Error | if resource creation failed, or on failure to compile the shader code or link the shader pipeline. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
The documentation for this class was generated from the following file: