LiteFX 0.4.1.2025
Computer Graphics Engine
|
Implements a render target. More...
#include <rendering_api.hpp>
Inherits LiteFX::Rendering::IRenderTarget.
Classes | |
class | RenderTargetImpl |
Public Member Functions | |
RenderTarget (UInt64 uid, UInt32 location, RenderTargetType type, Format format, RenderTargetFlags flags=RenderTargetFlags::None, const Vector4f &clearValues={ 0.f, 0.f, 0.f, 0.f }, const BlendState &blendState={}) | |
Initializes the render target. | |
RenderTarget (StringView name, UInt32 location, RenderTargetType type, Format format, RenderTargetFlags flags=RenderTargetFlags::None, const Vector4f &clearValues={ 0.f, 0.f, 0.f, 0.f }, const BlendState &blendState={}) | |
Initializes the render target. | |
RenderTarget (const RenderTarget &_other) | |
Creates a copy of a render target. | |
RenderTarget (RenderTarget &&_other) noexcept | |
Takes over another instance of a render target. | |
RenderTarget & | operator= (const RenderTarget &_other) |
Assigns a render target by copying it. | |
RenderTarget & | operator= (RenderTarget &&_other) noexcept |
Assigns a render target by taking it over. | |
~RenderTarget () noexcept override | |
Releases the render target instance. | |
UInt64 | identifier () const noexcept override |
A unique identifier for the render target.
| |
const String & | name () const noexcept override |
Returns the name of the render target.
| |
UInt32 | location () const noexcept override |
Returns the location of the render target output attachment within the fragment shader.The locations of all render targets of a frame buffer must be within a continuous domain, starting at 0 . A frame buffer validates the render target locations when it is initialized and will raise an exception, if a location is either not mapped or assigned multiple times. | |
RenderTargetType | type () const noexcept override |
Returns the type of the render target.
| |
Format | format () const noexcept override |
Returns the internal format of the render target.
| |
RenderTargetFlags | flags () const noexcept override |
Returns the flags that control the behavior of the render target.
| |
bool | clearBuffer () const noexcept override |
Returns true , if the render target should be cleared, when the render pass is started. If the format is set to a depth format, this clears the depth buffer. Otherwise it clears the color buffer.
| |
bool | clearStencil () const noexcept override |
Returns true , if the render target stencil should be cleared, when the render pass is started. If the format is does not contain a stencil channel, this has no effect.
| |
const Vector4f & | clearValues () const noexcept override |
Returns the value, the render target is cleared with, if clearBuffer either or clearStencil is specified.If the format is a color format and clearBuffer is specified, this contains the clear color. However, if the format is a depth/stencil format, the R and G channels contain the depth and stencil value to clear the buffer with. Note that the stencil buffer is only cleared, if clearStencil is specified and vice versa. | |
bool | isVolatile () const noexcept override |
Returns true , if the target should not be made persistent for access after the render pass has finished.A render target can be marked as volatile if it does not need to be accessed after the render pass has finished. This can be used to optimize away unnecessary GPU/CPU memory round-trips. For example a depth buffer may only be used as an input for the lighting stage of a deferred renderer, but is not required after this. So instead of reading it from the GPU after the lighting pass has finished and then discarding it anyway, it can be marked as volatile in order to prevent it from being read from the GPU memory again in the first place. | |
const BlendState & | blendState () const noexcept override |
Returns the render targets blend state.
| |
![]() | |
virtual | ~IRenderTarget () noexcept=default |
Additional Inherited Members | |
![]() | |
IRenderTarget () noexcept=default | |
IRenderTarget (const IRenderTarget &)=default | |
IRenderTarget (IRenderTarget &&) noexcept=default | |
IRenderTarget & | operator= (const IRenderTarget &)=default |
IRenderTarget & | operator= (IRenderTarget &&) noexcept=default |
Implements a render target.
|
explicit |
Initializes the render target.
uid | A unique identifier for the render target. |
location | The location of the render target output attachment. |
type | The type of the render target. |
format | The format of the render target. |
flags | The flags that control the behavior of the render target. |
clearValues | The values with which the render target gets cleared. |
blendState | The render target blend state. |
|
explicit |
Initializes the render target.
This overload uses the <paramname ref="name" > parameter to compute the identifier.
name | The unique name of the render target. |
location | The location of the render target output attachment. |
type | The type of the render target. |
format | The format of the render target. |
flags | The flags that control the behavior of the render target. |
clearValues | The values with which the render target gets cleared. |
blendState | The render target blend state. |
|
default |
Creates a copy of a render target.
_other | The render target instance to copy. |
|
defaultnoexcept |
Takes over another instance of a render target.
_other | The render target instance to take over. |
|
overridedefaultnoexcept |
Releases the render target instance.
|
overridevirtualnoexcept |
Returns the render targets blend state.
Implements LiteFX::Rendering::IRenderTarget.
|
overridevirtualnoexcept |
Returns true
, if the render target should be cleared, when the render pass is started. If the format is set to a depth format, this clears the depth buffer. Otherwise it clears the color buffer.
true
, if the render target should be cleared, when the render pass is startedImplements LiteFX::Rendering::IRenderTarget.
|
overridevirtualnoexcept |
Returns true
, if the render target stencil should be cleared, when the render pass is started. If the format is does not contain a stencil channel, this has no effect.
true
, if the render target stencil should be cleared, when the render pass is startedImplements LiteFX::Rendering::IRenderTarget.
|
overridevirtualnoexcept |
Returns the value, the render target is cleared with, if clearBuffer either or clearStencil is specified.If the format is a color format and clearBuffer is specified, this contains the clear color. However, if the format is a depth/stencil format, the R and G channels contain the depth and stencil value to clear the buffer with. Note that the stencil buffer is only cleared, if clearStencil is specified and vice versa.
Implements LiteFX::Rendering::IRenderTarget.
|
overridevirtualnoexcept |
Returns the flags that control the behavior of the render target.
Implements LiteFX::Rendering::IRenderTarget.
|
overridevirtualnoexcept |
Returns the internal format of the render target.
Implements LiteFX::Rendering::IRenderTarget.
|
overridevirtualnoexcept |
A unique identifier for the render target.
Implements LiteFX::Rendering::IRenderTarget.
|
overridevirtualnoexcept |
Returns true
, if the target should not be made persistent for access after the render pass has finished.A render target can be marked as volatile if it does not need to be accessed after the render pass has finished. This can be used to optimize away unnecessary GPU/CPU memory round-trips. For example a depth buffer may only be used as an input for the lighting stage of a deferred renderer, but is not required after this. So instead of reading it from the GPU after the lighting pass has finished and then discarding it anyway, it can be marked as volatile in order to prevent it from being read from the GPU memory again in the first place.
Implements LiteFX::Rendering::IRenderTarget.
|
overridevirtualnoexcept |
Returns the location of the render target output attachment within the fragment shader.The locations of all render targets of a frame buffer must be within a continuous domain, starting at 0
. A frame buffer validates the render target locations when it is initialized and will raise an exception, if a location is either not mapped or assigned multiple times.
Implements LiteFX::Rendering::IRenderTarget.
|
overridevirtualnoexcept |
Returns the name of the render target.
Implements LiteFX::Rendering::IRenderTarget.
|
default |
Assigns a render target by copying it.
_other | The render target instance to copy. |
|
defaultnoexcept |
Assigns a render target by taking it over.
_other | The render target to take over. |
|
overridevirtualnoexcept |
Returns the type of the render target.
Implements LiteFX::Rendering::IRenderTarget.