GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::Model3D::ShaderPipelineSetBase< VertexShaderConstants, VertexShaderOutputs, meta::TypeList< ExtraVertexShaderBuffers... >, FragmentShaderConstants, FragmentShaderOutputs, meta::TypeList< ExtraFragmentShaderBuffers... > > Class Template Reference

#include <GREM/graphics_3d/Model3D.hpp>

Public Types

using VertexShaderSelector = VertexShaderSelectorBase<VertexShaderConstants, VertexShaderOutputs, ExtraVertexShaderBuffers...>
 Adapter for a function that selects which vertex shader to use for a given shader configuration.
using FragmentShaderSelector = FragmentShaderSelectorBase<VertexShaderOutputs, FragmentShaderConstants, FragmentShaderOutputs, ExtraFragmentShaderBuffers...>
 Adapter for a function that selects which fragment shader to use for a given shader configuration.

Public Member Functions

 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)
 Construct a shader pipeline set.
const ShaderPipeline & operator() (const ShaderConfiguration &shaderConfiguration)
 Get the pipeline specialization corresponding to a specific mesh configuration.

Member Typedef Documentation

◆ VertexShaderSelector

template<typename VertexShaderConstants, typename VertexShaderOutputs, typename... ExtraVertexShaderBuffers, typename FragmentShaderConstants, typename FragmentShaderOutputs, typename... ExtraFragmentShaderBuffers>
using grem::graphics::Model3D::ShaderPipelineSetBase< VertexShaderConstants, VertexShaderOutputs, meta::TypeList< ExtraVertexShaderBuffers... >, FragmentShaderConstants, FragmentShaderOutputs, meta::TypeList< ExtraFragmentShaderBuffers... > >::VertexShaderSelector = VertexShaderSelectorBase<VertexShaderConstants, VertexShaderOutputs, ExtraVertexShaderBuffers...>

Adapter for a function that selects which vertex shader to use for a given shader configuration.

◆ FragmentShaderSelector

template<typename VertexShaderConstants, typename VertexShaderOutputs, typename... ExtraVertexShaderBuffers, typename FragmentShaderConstants, typename FragmentShaderOutputs, typename... ExtraFragmentShaderBuffers>
using grem::graphics::Model3D::ShaderPipelineSetBase< VertexShaderConstants, VertexShaderOutputs, meta::TypeList< ExtraVertexShaderBuffers... >, FragmentShaderConstants, FragmentShaderOutputs, meta::TypeList< ExtraFragmentShaderBuffers... > >::FragmentShaderSelector = FragmentShaderSelectorBase<VertexShaderOutputs, FragmentShaderConstants, FragmentShaderOutputs, ExtraFragmentShaderBuffers...>

Adapter for a function that selects which fragment shader to use for a given shader configuration.

Constructor & Destructor Documentation

◆ ShaderPipelineSetBase()

template<typename VertexShaderConstants, typename VertexShaderOutputs, typename... ExtraVertexShaderBuffers, typename FragmentShaderConstants, typename FragmentShaderOutputs, typename... ExtraFragmentShaderBuffers>
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
devicedevice to create the pipeline set for. Must outlive the pipeline set.
vertexShaderSelectorfunction that chooses which vertex shader to use for each shader configuration.
vertexShaderConstantsSelectorfunction that chooses which vertex shader constants to use for each shader configuration.
fragmentShaderSelectorfunction that chooses which fragment shader to use for each shader configuration.
fragmentShaderConstantsSelectorfunction that chooses which fragment shader constants to use for each shader configuration.
shaderPipelineOptionsSelectorfunction 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.

Member Function Documentation

◆ operator()()

template<typename VertexShaderConstants, typename VertexShaderOutputs, typename... ExtraVertexShaderBuffers, typename FragmentShaderConstants, typename FragmentShaderOutputs, typename... ExtraFragmentShaderBuffers>
const ShaderPipeline & grem::graphics::Model3D::ShaderPipelineSetBase< VertexShaderConstants, VertexShaderOutputs, meta::TypeList< ExtraVertexShaderBuffers... >, FragmentShaderConstants, FragmentShaderOutputs, meta::TypeList< ExtraFragmentShaderBuffers... > >::operator() ( const ShaderConfiguration & shaderConfiguration)
inlinenodiscard

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
shaderConfigurationshader 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::Errorif resource creation failed, or on failure to compile the shader code 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.

The documentation for this class was generated from the following file: