LiteFX 0.3.1.2022
Computer Graphics Engine
LiteFX::Rendering::IRenderPass Class Referenceabstract

The interface for a render pass. More...

#include <rendering_api.hpp>

Inherits LiteFX::Rendering::IStateResource.

Inherited by LiteFX::Rendering::RenderPass< DirectX12RenderPipeline, DirectX12FrameBuffer, DirectX12InputAttachmentMapping >, LiteFX::Rendering::RenderPass< VulkanRenderPipeline, VulkanFrameBuffer, VulkanInputAttachmentMapping >, and LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >.

Public Member Functions

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::IStateResource
virtual ~IStateResource () noexcept=default
 
virtual const Stringname () const noexcept=0
 Returns the name of the resource. More...
 

Detailed Description

The interface for a render pass.

Constructor & Destructor Documentation

◆ ~IRenderPass()

virtual LiteFX::Rendering::IRenderPass::~IRenderPass ( )
virtualdefaultnoexcept

Member Function Documentation

◆ activeFrameBuffer()

virtual const IFrameBuffer & LiteFX::Rendering::IRenderPass::activeFrameBuffer ( ) const
pure virtual

Returns the current frame buffer from of the render pass.

The frame buffer can only be obtained, if the render pass has been started by calling begin. If the render pass has ended or not yet started, the method will instead raise an exception.

Parameters
bufferThe index of the frame buffer.
Returns
A back buffer used by the render pass.

Implemented in LiteFX::Rendering::RenderPass< TRenderPipeline, TFrameBuffer, TInputAttachmentMapping >, LiteFX::Rendering::Backends::DirectX12RenderPass, LiteFX::Rendering::Backends::VulkanRenderPass, LiteFX::Rendering::RenderPass< DirectX12RenderPipeline, DirectX12FrameBuffer, DirectX12InputAttachmentMapping >, and LiteFX::Rendering::RenderPass< VulkanRenderPipeline, VulkanFrameBuffer, VulkanInputAttachmentMapping >.

◆ begin()

virtual void LiteFX::Rendering::IRenderPass::begin ( const UInt32 buffer)
pure virtual

Begins the render pass.

Parameters
bufferThe back buffer to use. Typically this is the same as the value returned from ISwapChain::swapBackBuffer.

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

◆ changeMultiSamplingLevel()

virtual void LiteFX::Rendering::IRenderPass::changeMultiSamplingLevel ( const MultiSamplingLevel &  samples)
pure virtual

Changes the multi sampling level of the render pass.

The method causes the frame buffers to be re-created. It checks, if the samples are supported by the device for each render target format. If not, an exception will be thrown. To prevent this, call <see cref=IGraphicsDevice::maximumMultiSamplingLevel" /> for each render target format on your own, in order to request the maximum number of samples supported. </remarks> <param name="samples">The number of samples per edge pixel.</param> <exception cref="InvalidArgumentException">Thrown, if one or more of the render targets have a format, that does not support the provided multi-sampling level.

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

◆ end()

virtual void LiteFX::Rendering::IRenderPass::end ( ) const
pure virtual

Ends the render pass.

If the frame buffer has a present render target, this causes the render pass to synchronize with the swap chain and issue a present command.

Parameters
bufferThe back buffer to use. Typically this is the same as the value returned from ISwapChain::swapBackBuffer.

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

◆ frameBuffers()

Array< const IFrameBuffer * > LiteFX::Rendering::IRenderPass::frameBuffers ( ) const
inlinenoexcept

Returns a list of all frame buffers.

Returns
A list of all frame buffers.

◆ hasPresentTarget()

virtual bool LiteFX::Rendering::IRenderPass::hasPresentTarget ( ) const
pure virtualnoexcept

Returns true, if one of the render targets is used for presentation on a swap chain.

Returns
true, if one of the render targets is used for presentation on a swap chain.
See also
renderTargets

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

◆ multiSamplingLevel()

virtual const MultiSamplingLevel & LiteFX::Rendering::IRenderPass::multiSamplingLevel ( ) const
pure virtualnoexcept

Returns the input attachment the render pass is consuming.

Returns
An array of input attachment mappings, that are mapped to the render pass.

Returns the number of samples, the render targets are sampled with.

Returns
The number of samples, the render targets are sampled with.

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

◆ pipelines()

Array< const IRenderPipeline * > LiteFX::Rendering::IRenderPass::pipelines ( ) const
inlinenoexcept

Returns an array of all render pipelines, owned by the render pass.

Returns
An array of all render pipelines, owned by the render pass.
See also
IRenderPipeline

◆ renderTarget()

virtual const RenderTarget & LiteFX::Rendering::IRenderPass::renderTarget ( const UInt32 location) const
pure virtual

Returns the render target mapped to the location provided by location .

Parameters
locationThe location to return the render target for.
Returns
The render target mapped to the location provided by location .

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

◆ renderTargets()

virtual Span< const RenderTarget > LiteFX::Rendering::IRenderPass::renderTargets ( ) const
pure virtualnoexcept

Returns the list of render targets, the render pass renders into.

Note that the actual render target image resources are stored within the individual FrameBuffers of the render pass.

Returns
A list of render targets, the render pass renders into.
See also
FrameBuffer, frameBuffer

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

◆ resizeFrameBuffers()

virtual void LiteFX::Rendering::IRenderPass::resizeFrameBuffers ( const Size2d renderArea)
pure virtual

Resets the frame buffers of the render pass.

Parameters
renderAreaThe size of the render area, the frame buffers will be resized to.

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

◆ updateAttachments()

void LiteFX::Rendering::IRenderPass::updateAttachments ( const IDescriptorSet descriptorSet) const
inline

Resolves the input attachments mapped to the render pass and updates them on the descriptor set provided with descriptorSet.

Parameters
descriptorSetThe descriptor set to update the input attachments on.