Represents a render target, i.e. an abstract view of the output of an RenderPass.
More...
#include <rendering_api.hpp>
Inherited by LiteFX::Rendering::RenderTarget.
|
virtual | ~IRenderTarget () noexcept=default |
|
virtual UInt64 | identifier () const noexcept=0 |
| A unique identifier for the render target.
|
|
virtual const String & | name () const noexcept=0 |
| Returns the name of the render target.
|
|
virtual UInt32 | location () const noexcept=0 |
| Returns the location of the render target output attachment within the fragment shader.
|
|
virtual RenderTargetType | type () const noexcept=0 |
| Returns the type of the render target.
|
|
virtual Format | format () const noexcept=0 |
| Returns the internal format of the render target.
|
|
virtual RenderTargetFlags | flags () const noexcept=0 |
| Returns the flags that control the behavior of the render target.
|
|
virtual bool | clearBuffer () const noexcept=0 |
| 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.
|
|
virtual bool | clearStencil () const noexcept=0 |
| 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.
|
|
virtual const Vector4f & | clearValues () const noexcept=0 |
| Returns the value, the render target is cleared with, if clearBuffer either or clearStencil is specified.
|
|
virtual bool | isVolatile () const noexcept=0 |
| Returns true , if the target should not be made persistent for access after the render pass has finished.
|
|
virtual const BlendState & | blendState () const noexcept=0 |
| Returns the render targets blend state.
|
|
Represents a render target, i.e. an abstract view of the output of an RenderPass.
A render target represents one output of a render pass, stored within an IImage. It is contained by a RenderPass, that maps it to an image resource on the FrameBuffer the render pass operates on. The IRenderTarget::identifier is used to associate an image within a frame buffer to a render target.
When using a IRenderPipeline during rendering, a similar lookup is performed to bind frame buffer images to input attachments.
- See also
- RenderTarget, RenderPass, FrameBuffer, IImage
◆ IRenderTarget() [1/3]
LiteFX::Rendering::IRenderTarget::IRenderTarget |
( |
| ) |
|
|
protecteddefaultnoexcept |
◆ IRenderTarget() [2/3]
LiteFX::Rendering::IRenderTarget::IRenderTarget |
( |
const IRenderTarget & | | ) |
|
|
protecteddefault |
◆ IRenderTarget() [3/3]
LiteFX::Rendering::IRenderTarget::IRenderTarget |
( |
IRenderTarget && | | ) |
|
|
protecteddefaultnoexcept |
◆ ~IRenderTarget()
virtual LiteFX::Rendering::IRenderTarget::~IRenderTarget |
( |
| ) |
|
|
virtualdefaultnoexcept |
◆ blendState()
virtual const BlendState & LiteFX::Rendering::IRenderTarget::blendState |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ clearBuffer()
virtual bool LiteFX::Rendering::IRenderTarget::clearBuffer |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ clearStencil()
virtual bool LiteFX::Rendering::IRenderTarget::clearStencil |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ clearValues()
virtual const Vector4f & LiteFX::Rendering::IRenderTarget::clearValues |
( |
| ) |
const |
|
pure virtualnoexcept |
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.
- Returns
- The value, the render target is cleared with, if clearBuffer either or clearStencil is specified.
Implemented in LiteFX::Rendering::RenderTarget.
◆ flags()
Returns the flags that control the behavior of the render target.
- Returns
- The flags that control the behavior of the render target.
Implemented in LiteFX::Rendering::RenderTarget.
◆ format()
virtual Format LiteFX::Rendering::IRenderTarget::format |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ identifier()
virtual UInt64 LiteFX::Rendering::IRenderTarget::identifier |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ isVolatile()
virtual bool LiteFX::Rendering::IRenderTarget::isVolatile |
( |
| ) |
const |
|
pure virtualnoexcept |
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.
- Returns
true
, if the target should not be made persistent for access after the render pass has finished.
- See also
- flags, RenderTargetFlags
Implemented in LiteFX::Rendering::RenderTarget.
◆ location()
virtual UInt32 LiteFX::Rendering::IRenderTarget::location |
( |
| ) |
const |
|
pure virtualnoexcept |
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.
- Returns
- The location of the render target output attachment within the fragment shader
Implemented in LiteFX::Rendering::RenderTarget.
◆ name()
virtual const String & LiteFX::Rendering::IRenderTarget::name |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ type()