GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::ShaderPipeline< Mesh > Class Template Reference

Linked GPU shader pipeline. More...

#include <GREM/graphics/shaders.hpp>

Inheritance diagram for grem::graphics::ShaderPipeline< Mesh >:

Public Types

using mesh_type = Mesh
 Mesh type of the shader pipeline.

Public Member Functions

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.

Detailed Description

template<typename Mesh>
class grem::graphics::ShaderPipeline< Mesh >

Linked GPU shader pipeline.

Template Parameters
Meshconcrete mesh type that will be rendered by this shader.

Member Typedef Documentation

◆ mesh_type

template<typename Mesh>
using grem::graphics::ShaderPipeline< Mesh >::mesh_type = Mesh

Mesh type of the shader pipeline.

Constructor & Destructor Documentation

◆ ShaderPipeline() [1/2]

template<typename Mesh>
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
devicedevice to create the shader pipeline for. Must outlive the shader pipeline.
vertexShadervertex shader stage of the shader pipeline.
vertexShaderConstantsconstant values to supply to the vertex shader.
fragmentShaderfragment shader stage of the shader pipeline.
fragmentShaderConstantsconstant values to supply to the fragment shader.
shaderPipelineOptionsconfiguration options, see ShaderPipelineOptions.
Exceptions
graphics::Erroron failure to create the shader pipeline object or link the shader pipeline.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.

◆ ShaderPipeline() [2/2]

template<typename Mesh>
template<typename VertexShaderConstants, typename FragmentShaderConstants>
grem::graphics::ShaderPipeline< Mesh >::ShaderPipeline ( Device & device,
SharedPointer< VertexShaderImplementation > vertexShaderHandle,
const VertexShaderConstants & vertexShaderConstants,
SharedPointer< FragmentShaderImplementation > fragmentShaderHandle,
const FragmentShaderConstants & fragmentShaderConstants,
const ShaderPipelineOptions & shaderPipelineOptions )
inline

Link a shader pipeline.

Parameters
devicedevice to create the shader pipeline for. Must outlive the shader pipeline.
vertexShaderHandlehandle to the vertex shader stage of the shader pipeline.
vertexShaderConstantsconstant values to supply to the vertex shader.
fragmentShaderHandlehandle to the fragment shader stage of the shader pipeline.
fragmentShaderConstantsconstant values to supply to the fragment shader.
shaderPipelineOptionsconfiguration options, see ShaderPipelineOptions.
Exceptions
graphics::Erroron failure to create the shader pipeline object or link the shader pipeline.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon 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: