Linked GPU shader pipeline.
More...
#include <GREM/graphics/shaders.hpp>
|
| template<typename VertexShaderMesh, typename VertexShaderConstants, typename VertexShaderOutputs, typename... VertexShaderBuffers, typename FragmentShaderMesh, typename FragmentShaderInputs, typename FragmentShaderConstants, typename FragmentShaderOutputs, typename... FragmentShaderBuffers> |
| | ShaderPipeline (Device &device, const VertexShader< VertexShaderMesh, VertexShaderConstants, VertexShaderOutputs, VertexShaderBuffers... > &vertexShader, const VertexShaderConstants &vertexShaderConstants, const FragmentShader< FragmentShaderMesh, FragmentShaderInputs, FragmentShaderConstants, FragmentShaderOutputs, FragmentShaderBuffers... > &fragmentShader, const FragmentShaderConstants &fragmentShaderConstants, const ShaderPipelineOptions &shaderPipelineOptions) |
| | Link a shader pipeline.
|
| template<typename VertexShaderConstants, typename FragmentShaderConstants> |
| | ShaderPipeline (Device &device, SharedPointer< VertexShaderImplementation > vertexShaderHandle, const VertexShaderConstants &vertexShaderConstants, SharedPointer< FragmentShaderImplementation > fragmentShaderHandle, const FragmentShaderConstants &fragmentShaderConstants, const ShaderPipelineOptions &shaderPipelineOptions) |
| | Link a shader pipeline.
|
template<typename
Mesh>
class grem::graphics::ShaderPipeline< Mesh >
Linked GPU shader pipeline.
- Template Parameters
-
| Mesh | concrete mesh type that will be rendered by this shader. |
◆ mesh_type
Mesh type of the shader pipeline.
◆ ShaderPipeline() [1/2]
template<typename VertexShaderMesh, typename VertexShaderConstants, typename VertexShaderOutputs, typename... VertexShaderBuffers, typename FragmentShaderMesh, typename FragmentShaderInputs, typename FragmentShaderConstants, typename FragmentShaderOutputs, typename... FragmentShaderBuffers>
| grem::graphics::ShaderPipeline< Mesh >::ShaderPipeline |
( |
Device & | device, |
|
|
const VertexShader< VertexShaderMesh, VertexShaderConstants, VertexShaderOutputs, VertexShaderBuffers... > & | vertexShader, |
|
|
const VertexShaderConstants & | vertexShaderConstants, |
|
|
const FragmentShader< FragmentShaderMesh, FragmentShaderInputs, FragmentShaderConstants, FragmentShaderOutputs, FragmentShaderBuffers... > & | fragmentShader, |
|
|
const FragmentShaderConstants & | fragmentShaderConstants, |
|
|
const ShaderPipelineOptions & | shaderPipelineOptions ) |
|
inline |
Link a shader pipeline.
- Parameters
-
| device | device to create the shader pipeline for. Must outlive the shader pipeline. |
| vertexShader | vertex shader stage of the shader pipeline. |
| vertexShaderConstants | constant values to supply to the vertex shader. |
| fragmentShader | fragment shader stage of the shader pipeline. |
| fragmentShaderConstants | constant values to supply to the fragment shader. |
| shaderPipelineOptions | configuration options, see ShaderPipelineOptions. |
- Exceptions
-
| graphics::Error | on failure to create the shader pipeline object 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. |
◆ ShaderPipeline() [2/2]
template<typename VertexShaderConstants, typename FragmentShaderConstants>
Link a shader pipeline.
- Parameters
-
| device | device to create the shader pipeline for. Must outlive the shader pipeline. |
| vertexShaderHandle | handle to the vertex shader stage of the shader pipeline. |
| vertexShaderConstants | constant values to supply to the vertex shader. |
| fragmentShaderHandle | handle to the fragment shader stage of the shader pipeline. |
| fragmentShaderConstants | constant values to supply to the fragment shader. |
| shaderPipelineOptions | configuration options, see ShaderPipelineOptions. |
- Exceptions
-
| graphics::Error | on failure to create the shader pipeline object 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. |
- 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 the mesh type specified in the Mesh template parameter of the shader pipeline.
-
The fragment shader's input type must match the vertex shader's output type.
-
Either all buffers used by the vertex shader must also be used by the fragment shader, and be listed before any additional buffers used by only the fragment shader, or the fragment shader must use no buffers at all.
The documentation for this class was generated from the following file: