CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::RendererGraphicsPipeline Class Reference

A renderer graphics pipeline. More...

#include <CeresEngine/Renderer/Resources/RendererGraphicsPipeline.hpp>

Inheritance diagram for CeresEngine::RendererGraphicsPipeline:
CeresEngine::RefCounted< RendererGraphicsPipeline >

Public Member Functions

 RendererGraphicsPipeline (RendererGraphicsPipelineManager &manager, StringView name, const RendererShaderPtr &shader, const GPURenderPassPtr &renderPass, const GPUPipelineLayoutPtr &pipelineLayout=nullptr)
 Creates a new renderer graphics pipeline instance.
 
 ~RendererGraphicsPipeline ()
 
GPUGraphicsPipelinePtr getPipeline (const RendererGraphicsPipelineSpecialization &specialization) const
 Gets the compiled graphics pipeline program for the given parameters.
 
GPUGraphicsPipelinePtr getPipeline (const GPUGraphicsPipelineState &state, const PrimitiveTopology primitiveTopology=PrimitiveTopology::Triangles, RendererShaderSpecialization shaderSpecialization={}) const
 Gets the compiled graphics pipeline program for the given parameters.
 
GPUGraphicsPipelinePtr getPipeline (VertexDeclaration vertexDeclaration, const GPUGraphicsPipelineState &state, const PrimitiveTopology primitiveTopology=PrimitiveTopology::Triangles, RendererShaderSpecialization shaderSpecialization={}) const
 Gets the compiled graphics pipeline program for the given parameters.
 
GPUGraphicsPipelinePtr getPipeline (const RendererMesh &mesh, const GPUGraphicsPipelineState &state, PrimitiveTopology primitiveTopology=PrimitiveTopology::Triangles, RendererShaderSpecialization shaderSpecialization={}) const
 Gets the compiled graphics pipeline program suitable for the given mesh.
 
GPUGraphicsPipelinePtr getPipeline (const RendererMeshPtr &mesh, const GPUGraphicsPipelineState &state, const PrimitiveTopology primitiveTopology=PrimitiveTopology::Triangles, RendererShaderSpecialization shaderSpecialization={}) const
 
const StringgetName () const noexcept
 A human-readable name to use on the pipeline.
 
const GPURenderPassPtrgetRenderPass () const noexcept
 Pointer to a RenderPass object. By default null.
 
const GPUPipelineLayoutPtrgetPipelineLayout () const noexcept
 Pointer to an optional pipeline layout for the graphics pipeline.
 
const RendererShaderPtrgetShader () const noexcept
 The shader to be used when creating new GPU Graphics Pipeline instances.
 
- Public Member Functions inherited from CeresEngine::RefCounted< RendererGraphicsPipeline >
 RefCounted (Args &&... args)
 Creates a new RefCounted object and constructs a new Deleter by forwarding Args to it.
 
void retain () noexcept
 Retains the object by increment it's reference count by one.
 
bool release () noexcept
 Relases the object by decrementing it's reference count by one.
 

Private Attributes

RendererGraphicsPipelineManagermManager
 The renderer graphics pipeline manager that owns this graphics pipeline object.
 
String mName
 A human-readable name to use on the pipeline.
 
RendererShaderPtr mShader
 The shader to be used when creating new GPU Graphics Pipeline instances.
 
GPURenderPassPtr mRenderPass = nullptr
 Pointer to a RenderPass object. By default null.
 
GPUPipelineLayoutPtr mPipelineLayout = nullptr
 Pointer to an optional pipeline layout for the graphics pipeline.
 
HashMap< UInt64, GPUGraphicsPipelinePtrmPipelines
 The graphics pipeline programs, indexed by their parameters hash.
 

Friends

class RendererGraphicsPipelineManager
 

Detailed Description

A renderer graphics pipeline.

This is similar to a GPUGraphicsPipeline but is managed by the renderer and allows mutation of certain parameters on runtime with automatic specialization by the renderer.

Constructor & Destructor Documentation

◆ RendererGraphicsPipeline()

CeresEngine::RendererGraphicsPipeline::RendererGraphicsPipeline ( RendererGraphicsPipelineManager manager,
StringView  name,
const RendererShaderPtr shader,
const GPURenderPassPtr renderPass,
const GPUPipelineLayoutPtr pipelineLayout = nullptr 
)
explicit

Creates a new renderer graphics pipeline instance.

Parameters
managerThe manager that owns this pipeline object.
nameA human-readable name to use on the pipeline.
shaderThe shader program that should be used when specializing the graphics pipeline.
renderPassA render pass instance on which the graphics pipeline will be used on.
pipelineLayoutThe pipeline layout object. If empty, one will be deduced from the shader and render pass.

◆ ~RendererGraphicsPipeline()

CeresEngine::RendererGraphicsPipeline::~RendererGraphicsPipeline ( )

Member Function Documentation

◆ getName()

const String & CeresEngine::RendererGraphicsPipeline::getName ( ) const
inlinenoexcept

A human-readable name to use on the pipeline.

◆ getPipeline() [1/5]

GPUGraphicsPipelinePtr CeresEngine::RendererGraphicsPipeline::getPipeline ( const GPUGraphicsPipelineState state,
const PrimitiveTopology  primitiveTopology = PrimitiveTopology::Triangles,
RendererShaderSpecialization  shaderSpecialization = {} 
) const
inline

Gets the compiled graphics pipeline program for the given parameters.

Parameters
stateA descriptor that describes the state of the graphics pipeline that should be managed by the renderer.
primitiveTopologyThe primitive topology to be used when rendering.
shaderSpecializationA description of the shader specialization to use.

◆ getPipeline() [2/5]

GPUGraphicsPipelinePtr CeresEngine::RendererGraphicsPipeline::getPipeline ( const RendererGraphicsPipelineSpecialization specialization) const

Gets the compiled graphics pipeline program for the given parameters.

Parameters
specializationThe pipeline specialization parameters.

◆ getPipeline() [3/5]

GPUGraphicsPipelinePtr CeresEngine::RendererGraphicsPipeline::getPipeline ( const RendererMesh mesh,
const GPUGraphicsPipelineState state,
PrimitiveTopology  primitiveTopology = PrimitiveTopology::Triangles,
RendererShaderSpecialization  shaderSpecialization = {} 
) const

Gets the compiled graphics pipeline program suitable for the given mesh.

Parameters
meshThe mesh to get a suitable pipeline program for.
primitiveTopologyThe primitive topology to be used when rendering.
stateA descriptor that describes the state of the graphics pipeline that should be managed by the renderer.
shaderSpecializationA description of the shader specialization to use.

◆ getPipeline() [4/5]

GPUGraphicsPipelinePtr CeresEngine::RendererGraphicsPipeline::getPipeline ( const RendererMeshPtr mesh,
const GPUGraphicsPipelineState state,
const PrimitiveTopology  primitiveTopology = PrimitiveTopology::Triangles,
RendererShaderSpecialization  shaderSpecialization = {} 
) const
inline

◆ getPipeline() [5/5]

GPUGraphicsPipelinePtr CeresEngine::RendererGraphicsPipeline::getPipeline ( VertexDeclaration  vertexDeclaration,
const GPUGraphicsPipelineState state,
const PrimitiveTopology  primitiveTopology = PrimitiveTopology::Triangles,
RendererShaderSpecialization  shaderSpecialization = {} 
) const
inline

Gets the compiled graphics pipeline program for the given parameters.

Parameters
vertexDeclarationThe vertex declaration that matches the rendered mesh.
stateA descriptor that describes the state of the graphics pipeline that should be managed by the renderer.
primitiveTopologyThe primitive topology to be used when rendering.
shaderSpecializationA description of the shader specialization to use.

◆ getPipelineLayout()

const GPUPipelineLayoutPtr & CeresEngine::RendererGraphicsPipeline::getPipelineLayout ( ) const
inlinenoexcept

Pointer to an optional pipeline layout for the graphics pipeline.

By default null.

◆ getRenderPass()

const GPURenderPassPtr & CeresEngine::RendererGraphicsPipeline::getRenderPass ( ) const
inlinenoexcept

Pointer to a RenderPass object. By default null.

◆ getShader()

const RendererShaderPtr & CeresEngine::RendererGraphicsPipeline::getShader ( ) const
inlinenoexcept

The shader to be used when creating new GPU Graphics Pipeline instances.

Friends And Related Symbol Documentation

◆ RendererGraphicsPipelineManager

Member Data Documentation

◆ mManager

RendererGraphicsPipelineManager& CeresEngine::RendererGraphicsPipeline::mManager
private

The renderer graphics pipeline manager that owns this graphics pipeline object.

◆ mName

String CeresEngine::RendererGraphicsPipeline::mName
private

A human-readable name to use on the pipeline.

◆ mPipelineLayout

GPUPipelineLayoutPtr CeresEngine::RendererGraphicsPipeline::mPipelineLayout = nullptr
private

Pointer to an optional pipeline layout for the graphics pipeline.

By default null.

◆ mPipelines

HashMap<UInt64, GPUGraphicsPipelinePtr> CeresEngine::RendererGraphicsPipeline::mPipelines
mutableprivate

The graphics pipeline programs, indexed by their parameters hash.

◆ mRenderPass

GPURenderPassPtr CeresEngine::RendererGraphicsPipeline::mRenderPass = nullptr
private

Pointer to a RenderPass object. By default null.

◆ mShader

RendererShaderPtr CeresEngine::RendererGraphicsPipeline::mShader
private

The shader to be used when creating new GPU Graphics Pipeline instances.


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