Lysa  0.0
Lysa 3D Engine
CustomRenderpass Class Referenceabstract

Detailed Description

Base class for user-defined render passes inserted at a RenderingPhase slot.

Derive from this class and override render() to inject arbitrary GPU work (graphics or compute) at a specific point in the frame graph. The pass is inserted after the built-in ShaderMaterialPass for the same phase.

+ Inheritance diagram for CustomRenderpass:

Public Member Functions

 CustomRenderpass (const RendererConfiguration &config, const std::string &name)
 
virtual void render (const std::shared_ptr< vireo::CommandList > &commandList, const std::shared_ptr< vireo::RenderTarget > &colorTarget, const std::shared_ptr< vireo::RenderTarget > &depthTarget, uint32 frameIndex) = 0
 
 ~CustomRenderpass () override = default
 
- Public Member Functions inherited from Renderpass
 Renderpass (const RendererConfiguration &config, const std::string &name)
 
virtual void resize (const vireo::Extent &extent, const std::shared_ptr< vireo::CommandList > &commandList)
 
virtual void update (uint32 frameIndex)
 
virtual ~Renderpass () = default
 
 Renderpass (Renderpass &) = delete
 
Renderpass & operator= (Renderpass &) = delete
 

Additional Inherited Members

- Static Public Member Functions inherited from Renderpass
static void destroyShaderModules ()
 
- Protected Member Functions inherited from Renderpass
std::shared_ptr< vireo::ShaderModule > loadShader (const std::string &shaderName) const
 
void init (vireo::GraphicPipelineConfiguration &pipelineConfig, vireo::RenderingConfiguration &renderingConfig, const std::shared_ptr< vireo::DescriptorLayout > &descriptorLayout, bool withStencil)
 
void init (vireo::GraphicPipelineConfiguration &pipelineConfig, vireo::RenderingConfiguration &renderingConfig, bool withStencil) const
 
void initForScene (vireo::GraphicPipelineConfiguration &pipelineConfig, vireo::RenderingConfiguration &renderingConfig, bool withStencil) const
 
void initRendering (const std::shared_ptr< vireo::CommandList > &commandList, const std::shared_ptr< vireo::GraphicPipeline > &pipeline, const std::shared_ptr< vireo::DescriptorSet > &sceneDescriptorSet, const std::shared_ptr< vireo::DescriptorSet > &descriptorSet)
 
void initCompute (const std::shared_ptr< vireo::CommandList > &commandList, const std::shared_ptr< vireo::ComputePipeline > &pipeline, const std::shared_ptr< vireo::DescriptorSet > &sceneDescriptorSet, const std::shared_ptr< vireo::DescriptorSet > &descriptorSet)
 
- Protected Attributes inherited from Renderpass
const std::string name
 
const RendererConfigurationconfig
 
- Static Protected Attributes inherited from Renderpass
static std::mutex shaderModulesMutex
 
static std::unordered_map< std::string, std::shared_ptr< vireo::ShaderModule > > shaderModules
 

Constructor & Destructor Documentation

CustomRenderpass ( const RendererConfiguration config,
const std::string &  name 
)
inline

Constructs a custom render pass.

Parameters
configRendering configuration (frame buffering, formats).
nameHuman-readable name for debugging.
~CustomRenderpass ( )
overridedefault

Member Function Documentation

virtual void render ( const std::shared_ptr< vireo::CommandList > &  commandList,
const std::shared_ptr< vireo::RenderTarget > &  colorTarget,
const std::shared_ptr< vireo::RenderTarget > &  depthTarget,
uint32  frameIndex 
)
pure virtual

Called once per frame for the associated RenderingPhase.

Parameters
commandListActive command list for the current frame.
colorTargetCurrent color render target at this phase.
depthTargetCurrent depth/stencil render target.
frameIndexIndex of the current frame in flight.