LiteFX 0.4.1.2025
Computer Graphics Engine
Loading...
Searching...
No Matches
LiteFX::Rendering::IRenderPass Class Referenceabstract

The interface for a render pass. More...

#include <rendering_api.hpp>

Inherits LiteFX::Rendering::IStateResource, and LiteFX::SharedObject.

Inherited by LiteFX::Rendering::RenderPass< DirectX12Queue, DirectX12FrameBuffer >, LiteFX::Rendering::RenderPass< VulkanQueue, VulkanFrameBuffer >, and LiteFX::Rendering::RenderPass< TCommandQueue, TFrameBuffer >.

Classes

struct  BeginEventArgs
 Event arguments that are published to subscribers when a render pass is beginning. More...
 

Public Member Functions

 ~IRenderPass () noexcept override=default
 
SharedPtr< const IFrameBufferactiveFrameBuffer () const noexcept
 Returns the current frame buffer from of the render pass.
 
const ICommandQueuecommandQueue () const noexcept
 Returns the command queue, the render pass is executing on or nullptr, if the queue has already been released.
 
Enumerable< SharedPtr< const ICommandBuffer > > commandBuffers () const
 Returns all command buffers, that can be currently used for recording multi-threaded commands in the render pass.
 
SharedPtr< const ICommandBuffercommandBuffer (UInt32 index) const
 Returns a command buffer that can be currently used for recording multi-threaded commands in the render pass.
 
virtual UInt32 secondaryCommandBuffers () const noexcept=0
 Returns the number of secondary command buffers the render pass stores for multi-threaded command recording.
 
virtual const Array< RenderTarget > & renderTargets () const noexcept=0
 Returns the list of render targets, the render pass renders into.
 
virtual const RenderTargetrenderTarget (UInt32 location) const =0
 Returns the render target mapped to the location provided by location .
 
virtual bool hasPresentTarget () const noexcept=0
 Returns true, if one of the render targets is used for presentation on a swap chain.
 
virtual const Array< RenderPassDependency > & inputAttachments () const noexcept=0
 Returns the input attachment the render pass is consuming.
 
virtual const RenderPassDependencyinputAttachment (UInt32 location) const =0
 Returns the input attachment at a location .
 
virtual const Optional< DescriptorBindingPoint > & inputAttachmentSamplerBinding () const noexcept=0
 Returns the binding point for input attachment samplers.
 
void begin (const IFrameBuffer &frameBuffer) const
 Begins the render pass.
 
virtual UInt64 end () const =0
 Ends the render pass.
 
- Public Member Functions inherited from LiteFX::Rendering::IStateResource
virtual ~IStateResource () noexcept=default
 Releases the state resource instance.
 
virtual const Stringname () const noexcept=0
 Returns the name of the resource.
 
- Public Member Functions inherited from LiteFX::SharedObject
virtual ~SharedObject () noexcept=default
 Destroys the shared object.
 
template<typename TSelf >
auto shared_from_this (this TSelf &&self) noexcept
 Returns a shared pointer to the current object instance.
 
template<typename TSelf >
auto weak_from_this (this TSelf &&self) noexcept -> WeakPtr< std::remove_reference_t< TSelf > >
 Returns a weak pointer to the current object instance.
 

Public Attributes

Event< BeginEventArgsbeginning
 Invoked, when the render pass is beginning.
 
Event< EventArgsending
 Invoked, when the render pass is ending.
 

Protected Member Functions

 IRenderPass () noexcept=default
 
 IRenderPass (IRenderPass &&) noexcept=default
 
 IRenderPass (const IRenderPass &)=delete
 
IRenderPassoperator= (IRenderPass &&) noexcept=default
 
IRenderPassoperator= (const IRenderPass &)=delete
 
- Protected Member Functions inherited from LiteFX::Rendering::IStateResource
 IStateResource () noexcept=default
 
 IStateResource (const IStateResource &)=delete
 
 IStateResource (IStateResource &&) noexcept=default
 
IStateResourceoperator= (const IStateResource &)=delete
 
IStateResourceoperator= (IStateResource &&) noexcept=default
 
- Protected Member Functions inherited from LiteFX::SharedObject
 SharedObject () noexcept=default
 Initializes a new shared object.
 
 SharedObject (SharedObject &&) noexcept=default
 
 SharedObject (const SharedObject &)=default
 
SharedObjectoperator= (SharedObject &&) noexcept=default
 
SharedObjectoperator= (const SharedObject &)=default
 

Additional Inherited Members

- Static Protected Member Functions inherited from LiteFX::SharedObject
template<typename T , typename... TArgs>
static auto create (TArgs &&... args) -> SharedPtr< T >
 Generic factory method used to create instances of the shared object.
 

Detailed Description

The interface for a render pass.

Constructor & Destructor Documentation

◆ IRenderPass() [1/3]

LiteFX::Rendering::IRenderPass::IRenderPass ( )
protecteddefaultnoexcept

◆ IRenderPass() [2/3]

LiteFX::Rendering::IRenderPass::IRenderPass ( IRenderPass && )
protecteddefaultnoexcept

◆ IRenderPass() [3/3]

LiteFX::Rendering::IRenderPass::IRenderPass ( const IRenderPass & )
protecteddelete

◆ ~IRenderPass()

LiteFX::Rendering::IRenderPass::~IRenderPass ( )
overridedefaultnoexcept

Member Function Documentation

◆ activeFrameBuffer()

SharedPtr< const IFrameBuffer > LiteFX::Rendering::IRenderPass::activeFrameBuffer ( ) const
inlinenoexcept

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 pointer to the currently active frame buffer or nullptr, if the render pass has not been started.
See also
begin

◆ begin()

void LiteFX::Rendering::IRenderPass::begin ( const IFrameBuffer & frameBuffer) const
inline

Begins the render pass.

Parameters
frameBufferThe frame buffer to obtain input attachments and render targets from.

◆ commandBuffer()

SharedPtr< const ICommandBuffer > LiteFX::Rendering::IRenderPass::commandBuffer ( UInt32 index) const
inline

Returns a command buffer that can be currently used for recording multi-threaded commands in the render pass.

Parameters
indexThe index of the command buffer.
Returns
A command buffer that can be currently used for recording multi-threaded commands in the render pass.
Exceptions
RuntimeExceptionThrown, if the render pass has not been begun.
ArgumentOutOfRangeExceptionThrown, if the frame buffer does not store a command buffer at index .
See also
commandBuffers

◆ commandBuffers()

Enumerable< SharedPtr< const ICommandBuffer > > LiteFX::Rendering::IRenderPass::commandBuffers ( ) const
inline

Returns all command buffers, that can be currently used for recording multi-threaded commands in the render pass.

Returns
All command buffers, that can be currently used for recording multi-threaded commands in the render pass, or an empty set, if the render pass has not been initialized with additional command buffers, or the render pass is currently not active.
See also
commandBuffer

◆ commandQueue()

const ICommandQueue & LiteFX::Rendering::IRenderPass::commandQueue ( ) const
inlinenoexcept

Returns the command queue, the render pass is executing on or nullptr, if the queue has already been released.

Returns
A pointer to the command queue, the render pass is executing on.

◆ end()

virtual UInt64 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.

Returns
The value of the fence that indicates the end of the render pass.

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

◆ 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.

◆ inputAttachment()

virtual const RenderPassDependency & LiteFX::Rendering::IRenderPass::inputAttachment ( UInt32 location) const
pure virtual

Returns the input attachment at a location .

Returns
The input attachment at a location .
Exceptions
ArgumentOutOfRangeExceptionThrown, if no input attachment is defined at the specified location .

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

◆ inputAttachments()

virtual const Array< RenderPassDependency > & LiteFX::Rendering::IRenderPass::inputAttachments ( ) 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.

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

◆ inputAttachmentSamplerBinding()

virtual const Optional< DescriptorBindingPoint > & LiteFX::Rendering::IRenderPass::inputAttachmentSamplerBinding ( ) const
pure virtualnoexcept

Returns the binding point for input attachment samplers.

Note that in Vulkan this is ignored, as render pass inputs are mapped to sub-pass inputs directly, which do not need to be sampled.

Returns
The binding point for input attachment samplers.

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

◆ operator=() [1/2]

IRenderPass & LiteFX::Rendering::IRenderPass::operator= ( const IRenderPass & )
protecteddelete

◆ operator=() [2/2]

IRenderPass & LiteFX::Rendering::IRenderPass::operator= ( IRenderPass && )
protecteddefaultnoexcept

◆ renderTarget()

virtual const RenderTarget & LiteFX::Rendering::IRenderPass::renderTarget ( 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 const Array< 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
IFrameBuffer

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

◆ secondaryCommandBuffers()

virtual UInt32 LiteFX::Rendering::IRenderPass::secondaryCommandBuffers ( ) const
pure virtualnoexcept

Returns the number of secondary command buffers the render pass stores for multi-threaded command recording.

Returns
The number of secondary command buffers the render pass stores for multi-threaded command recording.

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

Member Data Documentation

◆ beginning

Event<BeginEventArgs> LiteFX::Rendering::IRenderPass::beginning
mutable

Invoked, when the render pass is beginning.

See also
begin

◆ ending

Event<EventArgs> LiteFX::Rendering::IRenderPass::ending
mutable

Invoked, when the render pass is ending.

See also
end