SPARK
0.1.0
A general purpose game engine written in C++.
|
Implements a IRenderTarget. More...
#include <RenderTarget.h>
Classes | |
struct | Impl |
Public Member Functions | |
RenderTarget () noexcept | |
Initializes a default RenderTarget. | |
RenderTarget (unsigned int location, RenderTargetType type, Format format, bool clear_buffer, const math::Vector4< float > &clear_values={0.f, 0.f, 0.f, 0.f}, bool clear_stencil=true, bool is_volatile=false, const BlendState &blend_state={}) | |
Initializes the RenderTarget. | |
RenderTarget (const std::string &name, unsigned int location, RenderTargetType type, Format format, bool clear_buffer, const math::Vector4< float > &clear_values={0.f, 0.f, 0.f, 0.f}, bool clear_stencil=true, bool is_volatile=false, const BlendState &blend_state={}) | |
Initializes the RenderTarget. | |
RenderTarget (const RenderTarget &other) | |
RenderTarget (RenderTarget &&other) noexcept | |
RenderTarget & | operator= (const RenderTarget &other) |
RenderTarget & | operator= (RenderTarget &&other) noexcept |
std::string | name () const noexcept override |
Gets the name of the render target. | |
unsigned | location () const noexcept override |
Gets the location of the render target output attachment within the fragment shader. | |
RenderTargetType | type () const noexcept override |
Gets the type of the render target. | |
Format | format () const noexcept override |
Gets the internal format of the render target. | |
bool | clearBuffer () const noexcept override |
Checks if the render target should be cleared when the render pass is started. | |
bool | clearStencil () const noexcept override |
Checks if the render target stencil should be cleared when the render pass is started. | |
math::Vector4< float > | clearValues () const noexcept override |
Gets the value the render target is cleared with, if clearBuffer() or clearStencil() returns true . | |
bool | isVolatile () const noexcept override |
Checks if the target should not be persistent for access after the render pass has finished. | |
BlendState | blendState () const noexcept override |
Gets the render target blend state. | |
Implements a IRenderTarget.
|
explicit |
Initializes the RenderTarget.
location | The location of the render target output attachment. |
type | The type of the render target. |
format | The format of the render target. |
clear_buffer | true , if the render target should be cleared when the render pass is started, false otherwise. |
clear_values | The values with which the render target gets cleared. |
clear_stencil | true , if the render target stencil should be cleared when the render pass is started, false otherwise. |
is_volatile | true , if the target should not be persistent for access after the render pass has finished, false otherwise. |
blend_state | The blend state of the render target. |
|
explicit |
Initializes the RenderTarget.
name | The 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. |
clear_buffer | true , if the render target should be cleared when the render pass is started, false otherwise. |
clear_values | The values with which the render target gets cleared. |
clear_stencil | true , if the render target stencil should be cleared when the render pass is started, false otherwise. |
is_volatile | true , if the target should not be persistent for access after the render pass has finished, false otherwise. |
blend_state | The blend state of the render target. |
|
nodiscardoverridevirtualnoexcept |
Gets the render target blend state.
Implements spark::render::IRenderTarget.
|
overridevirtualnoexcept |
Checks if the render target should be cleared when the render pass is started.
true
, if the render target should be cleared when the render pass is started, false
otherwise. Implements spark::render::IRenderTarget.
|
overridevirtualnoexcept |
Checks if the render target stencil should be cleared when the render pass is started.
true
, if the render target stencil should be cleared when the render pass is started, false
otherwise. Implements spark::render::IRenderTarget.
|
nodiscardoverridevirtualnoexcept |
Gets the value the render target is cleared with, if clearBuffer() or clearStencil() returns true
.
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 spark::render::IRenderTarget.
|
nodiscardoverridevirtualnoexcept |
Gets the internal format of the render target.
Implements spark::render::IRenderTarget.
|
nodiscardoverridevirtualnoexcept |
Checks if the target should not be persistent for access after the render pass has finished.
true
, if the target should not be persistent for access after the render pass has finished, false
otherwise.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 spark::render::IRenderTarget.
|
nodiscardoverridevirtualnoexcept |
Gets 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 spark::render::IRenderTarget.
|
nodiscardoverridevirtualnoexcept |
Gets the name of the render target.
Implements spark::render::IRenderTarget.
|
nodiscardoverridevirtualnoexcept |
Gets the type of the render target.
Implements spark::render::IRenderTarget.