SPARK
0.1.0
A general purpose game engine written in C++.
|
Represents a render target, which is an abstract view of the output of a RenderPass. A render target represents one output of a render pass, stored within an IImage. It is contained by a RenderPass, that contains the FrameBuffer, that stores the actual render target image resource. More...
#include <RenderTarget.h>
Classes | |
struct | BlendState |
Describes the blend state of a render target. More... | |
Public Member Functions | |
virtual std::string | name () const noexcept=0 |
Gets the name of the render target. | |
virtual unsigned int | location () const noexcept=0 |
Gets the location of the render target output attachment within the fragment shader. | |
virtual RenderTargetType | type () const noexcept=0 |
Gets the type of the render target. | |
virtual Format | format () const noexcept=0 |
Gets the internal format of the render target. | |
virtual bool | clearBuffer () const noexcept=0 |
Checks if the render target should be cleared when the render pass is started. | |
virtual bool | clearStencil () const noexcept=0 |
Checks if the render target stencil should be cleared when the render pass is started. | |
virtual math::Vector4< float > | clearValues () const noexcept=0 |
Gets the value the render target is cleared with, if clearBuffer() or clearStencil() returns true . | |
virtual bool | isVolatile () const noexcept=0 |
Checks if the target should not be persistent for access after the render pass has finished. | |
virtual BlendState | blendState () const noexcept=0 |
Gets the render target blend state. | |
Represents a render target, which is an abstract view of the output of a RenderPass. A render target represents one output of a render pass, stored within an IImage. It is contained by a RenderPass, that contains the FrameBuffer, that stores the actual render target image resource.
|
nodiscardpure virtualnoexcept |
Gets the render target blend state.
Implemented in spark::render::RenderTarget.
|
pure virtualnoexcept |
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. Implemented in spark::render::RenderTarget.
|
pure virtualnoexcept |
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. Implemented in spark::render::RenderTarget.
|
nodiscardpure virtualnoexcept |
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.
Implemented in spark::render::RenderTarget.
|
nodiscardpure virtualnoexcept |
Gets the internal format of the render target.
Implemented in spark::render::RenderTarget.
|
nodiscardpure virtualnoexcept |
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.
Implemented in spark::render::RenderTarget.
|
nodiscardpure virtualnoexcept |
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.
Implemented in spark::render::RenderTarget.
|
nodiscardpure virtualnoexcept |
Gets the name of the render target.
Implemented in spark::render::RenderTarget.
|
nodiscardpure virtualnoexcept |
Gets the type of the render target.
Implemented in spark::render::RenderTarget.