LiteFX 0.3.1.2022
Computer Graphics Engine
LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping > Class Template Referenceabstract

Represents a render pass. More...

#include <rendering.hpp>

Inherits LiteFX::Rendering::StateResource, LiteFX::Rendering::IRenderPass, and LiteFX::Rendering::IInputAttachmentMappingSource< TFrameBuffer >.

Public Types

using frame_buffer_type = TFrameBuffer
 
using render_pipeline_type = TRenderPipeline
 
using input_attachment_mapping_type = TInputAttachmentMapping
 
using pipeline_layout_type = render_pipeline_type::pipeline_layout_type
 
using descriptor_set_layout_type = pipeline_layout_type::descriptor_set_layout_type
 
using descriptor_set_type = descriptor_set_layout_type::descriptor_set_type
 
- Public Types inherited from LiteFX::Rendering::IInputAttachmentMappingSource< TFrameBuffer >
using frame_buffer_type = TFrameBuffer
 

Public Member Functions

virtual ~RenderPass () noexcept=default
 
virtual const frame_buffer_typeactiveFrameBuffer () const =0
 Returns the current frame buffer from of the render pass. More...
 
virtual Array< const frame_buffer_type * > frameBuffers () const noexcept=0
 
virtual Array< const render_pipeline_type * > pipelines () const noexcept=0
 
virtual Span< const input_attachment_mapping_typeinputAttachments () const noexcept=0
 
virtual void updateAttachments (const descriptor_set_type &descriptorSet) const =0
 
- Public Member Functions inherited from LiteFX::Rendering::StateResource
 StateResource (StringView name)
 Initializes a new state resource instance. More...
 
 StateResource (StateResource &&)=delete
 
 StateResource (const StateResource &)=delete
 
virtual ~StateResource () noexcept
 
virtual const Stringname () const noexcept override
 Returns the name of the resource. More...
 
- Public Member Functions inherited from LiteFX::Rendering::IStateResource
virtual ~IStateResource () noexcept=default
 
virtual const Stringname () const noexcept=0
 Returns the name of the resource. More...
 
- Public Member Functions inherited from LiteFX::Rendering::IRenderPass
virtual ~IRenderPass () noexcept=default
 
virtual const IFrameBufferactiveFrameBuffer () const =0
 Returns the current frame buffer from of the render pass. More...
 
Array< const IFrameBuffer * > frameBuffers () const noexcept
 Returns a list of all frame buffers. More...
 
Array< const IRenderPipeline * > pipelines () const noexcept
 Returns an array of all render pipelines, owned by the render pass. More...
 
virtual const RenderTargetrenderTarget (const UInt32 &location) const =0
 Returns the render target mapped to the location provided by location . More...
 
virtual Span< const RenderTargetrenderTargets () const noexcept=0
 Returns the list of render targets, the render pass renders into. More...
 
virtual bool hasPresentTarget () const noexcept=0
 Returns true, if one of the render targets is used for presentation on a swap chain. More...
 
virtual const MultiSamplingLevel & multiSamplingLevel () const noexcept=0
 Returns the input attachment the render pass is consuming. More...
 
virtual void begin (const UInt32 &buffer)=0
 Begins the render pass. More...
 
virtual void end () const =0
 Ends the render pass. More...
 
virtual void resizeFrameBuffers (const Size2d &renderArea)=0
 Resets the frame buffers of the render pass. More...
 
virtual void changeMultiSamplingLevel (const MultiSamplingLevel &samples)=0
 Changes the multi sampling level of the render pass. More...
 
void updateAttachments (const IDescriptorSet &descriptorSet) const
 Resolves the input attachments mapped to the render pass and updates them on the descriptor set provided with descriptorSet. More...
 
- Public Member Functions inherited from LiteFX::Rendering::IInputAttachmentMappingSource< TFrameBuffer >
virtual ~IInputAttachmentMappingSource () noexcept=default
 
virtual const frame_buffer_typeframeBuffer (const UInt32 &buffer) const =0
 Returns the frame buffer with the index provided in buffer . More...
 

Additional Inherited Members

- Protected Member Functions inherited from LiteFX::Rendering::StateResource
 StateResource () noexcept
 
Stringname () noexcept
 

Detailed Description

template<typename TRenderPipeline, typename TFrameBuffer, typename TInputAttachmentMapping>
requires rtti::implements<TFrameBuffer, FrameBuffer<typename TFrameBuffer::command_buffer_type>> && rtti::implements<TRenderPipeline, RenderPipeline<typename TRenderPipeline::pipeline_layout_type, typename TRenderPipeline::shader_program_type, typename TRenderPipeline::input_assembler_type, typename TRenderPipeline::rasterizer_type>>
class LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >

Represents a render pass.

A render pass is a conceptual layer, that may not have any logical representation within the actual implementation. It is a high-level view on a specific workload on the GPU, that processes data using different RenderPipelines and stores the outputs in the IRenderTargets of a FrameBuffer.

Template Parameters
TRenderPipelineThe type of the render pipeline. Must implement RenderPipeline.
TFrameBufferThe type of the frame buffer. Must implement FrameBuffer.
TInputAttachmentMappingThe type of the input attachment mapping. Must implement IInputAttachmentMapping.

Member Typedef Documentation

◆ descriptor_set_layout_type

template<typename TRenderPipeline , typename TFrameBuffer , typename TInputAttachmentMapping >
using LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >::descriptor_set_layout_type = pipeline_layout_type::descriptor_set_layout_type

◆ descriptor_set_type

template<typename TRenderPipeline , typename TFrameBuffer , typename TInputAttachmentMapping >
using LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >::descriptor_set_type = descriptor_set_layout_type::descriptor_set_type

◆ frame_buffer_type

template<typename TRenderPipeline , typename TFrameBuffer , typename TInputAttachmentMapping >
using LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >::frame_buffer_type = TFrameBuffer

◆ input_attachment_mapping_type

template<typename TRenderPipeline , typename TFrameBuffer , typename TInputAttachmentMapping >
using LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >::input_attachment_mapping_type = TInputAttachmentMapping

◆ pipeline_layout_type

template<typename TRenderPipeline , typename TFrameBuffer , typename TInputAttachmentMapping >
using LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >::pipeline_layout_type = render_pipeline_type::pipeline_layout_type

◆ render_pipeline_type

template<typename TRenderPipeline , typename TFrameBuffer , typename TInputAttachmentMapping >
using LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >::render_pipeline_type = TRenderPipeline

Constructor & Destructor Documentation

◆ ~RenderPass()

template<typename TRenderPipeline , typename TFrameBuffer , typename TInputAttachmentMapping >
virtual LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >::~RenderPass ( )
virtualdefaultnoexcept

Member Function Documentation

◆ activeFrameBuffer()

template<typename TRenderPipeline , typename TFrameBuffer , typename TInputAttachmentMapping >
virtual const frame_buffer_type & LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >::activeFrameBuffer ( ) const
pure virtual

Returns the current frame buffer from of the render pass.

Implements LiteFX::Rendering::IRenderPass.

Implemented in LiteFX::Rendering::Backends::DirectX12RenderPass, and LiteFX::Rendering::Backends::VulkanRenderPass.

◆ frameBuffers()

template<typename TRenderPipeline , typename TFrameBuffer , typename TInputAttachmentMapping >
virtual Array< const frame_buffer_type * > LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >::frameBuffers ( ) const
pure virtualnoexcept

◆ inputAttachments()

template<typename TRenderPipeline , typename TFrameBuffer , typename TInputAttachmentMapping >
virtual Span< const input_attachment_mapping_type > LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >::inputAttachments ( ) const
pure virtualnoexcept

◆ pipelines()

template<typename TRenderPipeline , typename TFrameBuffer , typename TInputAttachmentMapping >
virtual Array< const render_pipeline_type * > LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >::pipelines ( ) const
pure virtualnoexcept

◆ updateAttachments()

template<typename TRenderPipeline , typename TFrameBuffer , typename TInputAttachmentMapping >
virtual void LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >::updateAttachments ( const descriptor_set_type descriptorSet) const
pure virtual