Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
RenderPipeline Class Reference

Render Pipeline provides a flexible way to execute rendering steps in the engine. More...

#include <pipeline.h>

+ Inheritance diagram for RenderPipeline:
+ Collaboration diagram for RenderPipeline:

Public Member Functions

RenderStepaddStep (RenderStep *step)
 Add a step to the end of the pipeline.
 
template<typename T >
T * own (std::unique_ptr< T > &&object)
 Capture ownership of a dynamically created.
 
template<typename T , typename... Args>
T * createOwned (Args &&... args)
 Create a new object that will be managed by the pipeline.
 
template<typename T , typename... Args>
T * addStep (Args &&... args)
 Create and add a step managed by the pipeline and return a pointer to the step for further configuration.
 
RenderSourcegetInput ()
 
RenderTargetgetOutput ()
 
v2f getScale ()
 
void setScale (v2f value)
 
virtual void reset (PipelineContext &context) override
 
virtual void run (PipelineContext &context) override
 Runs the step.
 
virtual void setRenderSource (RenderSource *source) override
 Assigns render source to this step.
 
virtual void setRenderTarget (RenderTarget *target) override
 Assigned render target to this step.
 
- Public Member Functions inherited from RenderPipelineObject
virtual ~RenderPipelineObject ()=default
 

Private Attributes

std::vector< RenderStep * > m_pipeline
 
std::vector< std::unique_ptr< RenderPipelineObject > > m_objects
 
DynamicSource m_input
 
DynamicTarget m_output
 
v2f scale { 1.0f, 1.0f }
 

Detailed Description

Render Pipeline provides a flexible way to execute rendering steps in the engine.

RenderPipeline also implements

See also
RenderStep, allowing for nesting of the pipelines.

Member Function Documentation

◆ addStep() [1/2]

template<typename T , typename... Args>
T * RenderPipeline::addStep ( Args &&... args)
inline

Create and add a step managed by the pipeline and return a pointer to the step for further configuration.

Template Parameters
TType of the step to be added.
ArgsTypes of the constructor parameters
Parameters
argsConstructor parameters
Returns
RenderStep* Pointer to the created step for further configuration.

References addStep(), and own().

+ Here is the call graph for this function:

◆ addStep() [2/2]

RenderStep * RenderPipeline::addStep ( RenderStep * step)
inline

Add a step to the end of the pipeline.

Parameters
stepreference to a
See also
RenderStep implementation.

References m_pipeline.

Referenced by addPostProcessing(), addStep(), addUpscaling(), create3DStage(), createPipeline(), populateAnaglyphPipeline(), populateInterlacedPipeline(), populatePlainPipeline(), and populateSideBySidePipeline().

+ Here is the caller graph for this function:

◆ createOwned()

template<typename T , typename... Args>
T * RenderPipeline::createOwned ( Args &&... args)
inline

Create a new object that will be managed by the pipeline.

Template Parameters
Ttype of the object to be created
Argstypes of constructor arguments
Parameters
argsconstructor arguments
Returns
T* pointer to the newly created object

References own().

Referenced by addPostProcessing(), addUpscaling(), populateAnaglyphPipeline(), populateInterlacedPipeline(), populatePlainPipeline(), and populateSideBySidePipeline().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInput()

RenderSource * RenderPipeline::getInput ( )

References m_input.

◆ getOutput()

RenderTarget * RenderPipeline::getOutput ( )

References m_output.

Referenced by create3DStage().

+ Here is the caller graph for this function:

◆ getScale()

v2f RenderPipeline::getScale ( )
inline

References scale.

◆ own()

template<typename T >
T * RenderPipeline::own ( std::unique_ptr< T > && object)
inline

Capture ownership of a dynamically created.

See also
RenderStep instance.

RenderPipeline will delete the instance when the pipeline is destroyed.

Parameters
stepreference to the instance.
Returns
RenderStep* value of the 'step' parameter.

References m_objects.

Referenced by addStep(), create3DStage(), createOwned(), populateAnaglyphPipeline(), populateInterlacedPipeline(), populatePlainPipeline(), and populateSideBySidePipeline().

+ Here is the caller graph for this function:

◆ reset()

virtual void RenderPipeline::reset ( PipelineContext & context)
inlineoverridevirtual

Reimplemented from RenderPipelineObject.

Referenced by RenderingCore::draw().

+ Here is the caller graph for this function:

◆ run()

void RenderPipeline::run ( PipelineContext & context)
overridevirtual

Runs the step.

This method is invoked by the pipeline.

Implements RenderStep.

References m_objects, m_pipeline, scale, and PipelineContext::target_size.

Referenced by RenderingCore::draw().

+ Here is the caller graph for this function:

◆ setRenderSource()

void RenderPipeline::setRenderSource ( RenderSource * source)
overridevirtual

Assigns render source to this step.

Parameters
sourcesource of rendering information

Implements RenderStep.

References m_input, and DynamicSource::setRenderSource().

+ Here is the call graph for this function:

◆ setRenderTarget()

void RenderPipeline::setRenderTarget ( RenderTarget * target)
overridevirtual

Assigned render target to this step.

Parameters
targetrender target to send output to.

Implements RenderStep.

References m_output, and DynamicTarget::setRenderTarget().

+ Here is the call graph for this function:

◆ setScale()

void RenderPipeline::setScale ( v2f value)
inline

References scale.

Member Data Documentation

◆ m_input

DynamicSource RenderPipeline::m_input
private

Referenced by getInput(), and setRenderSource().

◆ m_objects

std::vector< std::unique_ptr<RenderPipelineObject> > RenderPipeline::m_objects
private

Referenced by own(), and run().

◆ m_output

DynamicTarget RenderPipeline::m_output
private

Referenced by getOutput(), and setRenderTarget().

◆ m_pipeline

std::vector<RenderStep *> RenderPipeline::m_pipeline
private

Referenced by addStep(), and run().

◆ scale

v2f RenderPipeline::scale { 1.0f, 1.0f }
private

Referenced by getScale(), run(), and setScale().


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