|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Backend-specific implementation of RenderPass. More...
#include <GREM/graphics/RenderPass.hpp>
Classes | |
| struct | Statistics |
| Performance-related statistics of a render pass. More... | |
Public Member Functions | |
| RenderPass (Device &device, Span< const TextureSubresourceReference > renderTargets, const ClearMode &clearMode, Optional< Viewport > viewport={}) | |
| Construct a render pass. | |
| GREM_ALWAYS_INLINE | RenderPass (Device &device, TextureSubresourceReference renderTarget, const ClearMode &clearMode, Optional< Viewport > viewport={}) |
| Construct a render pass. | |
| RenderPass (Device &device, TextureSubresourceReference resolveTarget, const ResolveMode &resolveMode, Span< const TextureSubresourceReference > renderTargets, const ClearMode &clearMode, Optional< Viewport > viewport={}) | |
| Construct a multisampled render pass that resolves to a resolve target at the end of the render. | |
| GREM_ALWAYS_INLINE | RenderPass (Device &device, TextureSubresourceReference resolveTarget, const ResolveMode &resolveMode, TextureSubresourceReference renderTarget, const ClearMode &clearMode, Optional< Viewport > viewport={}) |
| Construct a multisampled render pass that resolves to a resolve target at the end of the render. | |
| ~RenderPass () | |
| Destructor. | |
| RenderPass (const RenderPass &)=delete | |
| Copying a render pass is not allowed. | |
| RenderPass (RenderPass &&)=delete | |
| Moving a render pass is not allowed. | |
| RenderPass & | operator= (const RenderPass &)=delete |
| Copying a render pass is not allowed. | |
| RenderPass & | operator= (RenderPass &&)=delete |
| Moving a render pass is not allowed. | |
| RenderPass & | setViewport (const Viewport &viewport) |
| Set the viewport and scissor area to use for subsequently recorded draw commands. | |
| RenderPass & | setViewportScissor (const Optional< Region2D > &scissor) |
| Set the scissor area to use for subsequently recoreded draw commands. | |
| const Viewport & | getViewport () |
| Get the viewport that will be used for subsequently recorded draw commands. | |
| Extent2D | getFramebufferSize () |
| Get the size of the framebuffer that the render pass will be rendering through. | |
| RenderPass & | fill (const Region2D &targetRegion, const ClearValues &values) |
| Record a command to fill the contents of a rectangular region of the render targets. | |
| RenderPass & | fill (const ClearValues &values) |
| Record a command to fill the full contents of the render targets. | |
| template<typename Vertex, typename Index, typename Parameters, typename Instance, typename... Buffers> | |
| RenderPass & | draw (const DrawCommandBuffer< Mesh< Vertex, Index, Parameters, Instance > > &drawCommandBuffer, const InstanceBuffer< Instance > &instanceBuffer, const Buffers &... buffers) |
| Record the commands to draw the contents of a draw command buffer using a set of shader buffers to the current viewport region of the render targets. | |
| template<typename Vertex, typename Index, typename Parameters, typename... Buffers> | |
| RenderPass & | draw (const DrawCommandBuffer< Mesh< Vertex, Index, Parameters, NoInstance > > &drawCommandBuffer, const Buffers &... buffers) |
| Record the commands to draw the contents of a draw command buffer using a set of shader buffers to the current viewport region of the render targets. | |
| RenderPass & | draw (SharedPointer< DrawCommandBufferImplementation > drawCommandBufferHandle, SharedPointer< InstanceBufferImplementation > instanceBufferHandle, Span< const Pair< BufferLayoutReference, SharedPointer< void > > > bufferHandles) |
| Record the commands to draw the contents of a draw command buffer using a set of shader buffers to the current viewport region of the render targets. | |
| template<typename Vertex, typename Index, typename Parameters, typename Instance, typename... Buffers> | |
| RenderPass & | drawShaded (const ShaderPipeline< Mesh< Vertex, Index, Parameters, Instance > > &shaderPipelineOverride, const DrawCommandBuffer< Mesh< Vertex, Index, Parameters, Instance > > &drawCommandBuffer, const InstanceBuffer< Instance > &instanceBuffer, const Buffers &... buffers) |
| Record the commands to draw the contents of a draw command buffer with specific shaders using a set of shader buffers to the current viewport region of the render targets. | |
| template<typename Vertex, typename Index, typename Parameters, typename... Buffers> | |
| RenderPass & | drawShaded (const ShaderPipeline< Mesh< Vertex, Index, Parameters, NoInstance > > &shaderPipelineOverride, const DrawCommandBuffer< Mesh< Vertex, Index, Parameters, NoInstance > > &drawCommandBuffer, const Buffers &... buffers) |
| Record the commands to draw the contents of a draw command buffer with specific shaders using a set of shader buffers to the current viewport region of the render targets. | |
| RenderPass & | drawShaded (SharedPointer< ShaderPipelineImplementation > shaderPipelineOverrideHandle, SharedPointer< DrawCommandBufferImplementation > drawCommandBufferHandle, SharedPointer< InstanceBufferImplementation > instanceBufferHandle, Span< const Pair< BufferLayoutReference, SharedPointer< void > > > bufferHandles) |
| Record a command to draw the contents of a draw command buffer with specific shaders using a set of shader buffers to the current viewport region of the render targets. | |
| template<typename Vertex, typename Index, typename Parameters, typename Instance, typename... Buffers> | |
| RenderPass & | drawUnordered (const UnorderedDrawCommandBuffer< Mesh< Vertex, Index, Parameters, Instance > > &drawCommandBuffer, const InstanceBuffer< Instance > &instanceBuffer, const Buffers &... buffers) |
| Record the commands to draw the contents of an unordered draw command buffer using a set of shader buffers to the current viewport region of the render targets. | |
| template<typename Vertex, typename Index, typename Parameters, typename... Buffers> | |
| RenderPass & | drawUnordered (const UnorderedDrawCommandBuffer< Mesh< Vertex, Index, Parameters, NoInstance > > &drawCommandBuffer, const Buffers &... buffers) |
| Record the commands to draw the contents of an unordered draw command buffer using a set of shader buffers to the current viewport region of the render targets. | |
| RenderPass & | drawUnordered (SharedPointer< UnorderedDrawCommandBufferImplementation > drawCommandBufferHandle, SharedPointer< InstanceBufferImplementation > instanceBufferHandle, Span< const Pair< BufferLayoutReference, SharedPointer< void > > > bufferHandles) |
| Record the commands to draw the contents of an unordered draw command buffer using a set of shader buffers to the current viewport region of the render targets. | |
| template<typename Vertex, typename Index, typename Parameters, typename Instance, typename... Buffers> | |
| RenderPass & | drawShadedUnordered (const ShaderPipeline< Mesh< Vertex, Index, Parameters, Instance > > &shaderPipelineOverride, const UnorderedDrawCommandBuffer< Mesh< Vertex, Index, Parameters, Instance > > &drawCommandBuffer, const InstanceBuffer< Instance > &instanceBuffer, const Buffers &... buffers) |
| Record the commands to draw the contents of an unordered draw command buffer with specific shaders using a set of shader buffers to the current viewport region of the render targets. | |
| template<typename Vertex, typename Index, typename Parameters, typename... Buffers> | |
| RenderPass & | drawShadedUnordered (const ShaderPipeline< Mesh< Vertex, Index, Parameters, NoInstance > > &shaderPipelineOverride, const UnorderedDrawCommandBuffer< Mesh< Vertex, Index, Parameters, NoInstance > > &drawCommandBuffer, const Buffers &... buffers) |
| Record the commands to draw the contents of an unordered draw command buffer with specific shaders using a set of shader buffers to the current viewport region of the render targets. | |
| RenderPass & | drawShadedUnordered (SharedPointer< ShaderPipelineImplementation > shaderPipelineOverrideHandle, SharedPointer< UnorderedDrawCommandBufferImplementation > drawCommandBufferHandle, SharedPointer< InstanceBufferImplementation > instanceBufferHandle, Span< const Pair< BufferLayoutReference, SharedPointer< void > > > bufferHandles) |
| Record the commands to draw the contents of an unordered draw command buffer with specific shaders using a set of shader buffers to the current viewport region of the render targets. | |
| Statistics | getStatistics () const |
| Get the current statistics of the render pass. | |
| SharedPointer< RenderPassImplementation > | lock () const |
| Get a lock for the underlying resource implementation. | |
| RenderPassImplementation * | get () noexcept |
| Get a pointer to the underlying resource implementation. | |
| const RenderPassImplementation * | get () const noexcept |
| Get a pointer to the underlying resource implementation. | |
Backend-specific implementation of RenderPass.
List of draw commands to be rendered onto a set of render targets using a Device.
| grem::graphics::RenderPass::RenderPass | ( | Device & | device, |
| Span< const TextureSubresourceReference > | renderTargets, | ||
| const ClearMode & | clearMode, | ||
| Optional< Viewport > | viewport = {} ) |
Construct a render pass.
| device | device to create the render pass for. Must outlive the render pass. |
| renderTargets | set of render targets to render to. Must not be empty. All textures must have the same 2D size, which must fit in device.getSupportedFeatures().maxFramebufferSize. The texture aspects must not overlap between targets. If any target is multisampled, all other targets must also be multisampled with the same number of samples. |
| clearMode | one of RetainValues, ClearValues or UndefinedClearValues, specifying whether/how to retain/clear the render target contents at the beginning of the render pass. |
| viewport | initial viewport to use for subsequently recorded draw commands, or an empty optional to choose a default viewport that fits the render targets. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Construct a render pass.
| device | device to create the render pass for. Must outlive the render pass. |
| renderTarget | render target to render to, whose 2D size must fit in device.getSupportedFeatures().maxFramebufferSize. |
| clearMode | one of RetainValues, ClearValues or UndefinedClearValues, specifying whether/how to retain/clear the render target contents at the beginning of the render pass. |
| viewport | initial viewport to use for subsequently recorded draw commands, or an empty optional to choose a default viewport that fits the render target. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| grem::graphics::RenderPass::RenderPass | ( | Device & | device, |
| TextureSubresourceReference | resolveTarget, | ||
| const ResolveMode & | resolveMode, | ||
| Span< const TextureSubresourceReference > | renderTargets, | ||
| const ClearMode & | clearMode, | ||
| Optional< Viewport > | viewport = {} ) |
Construct a multisampled render pass that resolves to a resolve target at the end of the render.
| device | device to create the render pass for. Must outlive the render pass. |
| resolveTarget | resolve target to resolve the color target to at the end of each render. Must have the color texture aspect. Must not be multisampled. |
| resolveMode | one of StoreIntermediateValues or DiscardIntermediateValues, specifying whether/how to store/discard the intermediate results after the resolve. Discarding the values may help the driver to optimize memory usage, while storing them allows the intermediate color/depth-stencil buffers to be sampled or used in further render passes. |
| renderTargets | set of render targets to render to. Must not be empty. All textures must have the same 2D size, which must fit in device.getSupportedFeatures().maxFramebufferSize. The texture aspects must not overlap between targets. All targets must be multisampled and use the same number of samples. Must contain a target with the color texture aspect. |
| clearMode | one of RetainValues, ClearValues or UndefinedClearValues, specifying whether/how to retain/clear the render target contents at the beginning of the render pass. |
| viewport | initial viewport to use for subsequently recorded draw commands, or an empty optional to choose a default viewport that fits the render targets. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Construct a multisampled render pass that resolves to a resolve target at the end of the render.
| device | device to create the render pass for. Must outlive the render pass. |
| resolveTarget | resolve target to resolve the color target to at the end of each render. Must have the color texture aspect. Must not be multisampled. |
| resolveMode | one of StoreIntermediateValues or DiscardIntermediateValues, specifying whether/how to store/discard the intermediate results after the resolve. Discarding the values may help the driver to optimize memory usage, while storing them allows the intermediate color/depth-stencil buffers to be sampled or used in further render passes. |
| renderTarget | render target to render to, whose 2D size must fit in device.getSupportedFeatures().maxFramebufferSize. Must be multisampled. Must have the color texture aspect. |
| clearMode | one of RetainValues, ClearValues or UndefinedClearValues, specifying whether/how to retain/clear the render target contents at the beginning of the render pass. |
| viewport | initial viewport to use for subsequently recorded draw commands, or an empty optional to choose a default viewport that fits the render target. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| grem::graphics::RenderPass::~RenderPass | ( | ) |
Destructor.
|
delete |
Copying a render pass is not allowed.
|
delete |
Moving a render pass is not allowed.
|
delete |
Copying a render pass is not allowed.
|
delete |
Moving a render pass is not allowed.
| RenderPass & grem::graphics::RenderPass::setViewport | ( | const Viewport & | viewport | ) |
Set the viewport and scissor area to use for subsequently recorded draw commands.
| viewport | region of the render targets to render to. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| RenderPass & grem::graphics::RenderPass::setViewportScissor | ( | const Optional< Region2D > & | scissor | ) |
Set the scissor area to use for subsequently recoreded draw commands.
| scissor | rectangular region outside of which any attempts to render a pixel will be discarded, or an empty optional to use the full viewport area. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
nodiscard |
Get the viewport that will be used for subsequently recorded draw commands.
|
nodiscard |
Get the size of the framebuffer that the render pass will be rendering through.
| RenderPass & grem::graphics::RenderPass::fill | ( | const Region2D & | targetRegion, |
| const ClearValues & | values ) |
Record a command to fill the contents of a rectangular region of the render targets.
| targetRegion | rectangular area of the render targets to fill. Must be a valid region of the render targets. |
| values | values to fill the specified render target aspects with. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Record a command to fill the full contents of the render targets.
| values | values to fill the specified render target aspects with. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Record the commands to draw the contents of a draw command buffer using a set of shader buffers to the current viewport region of the render targets.
| drawCommandBuffer | the buffer of draw commands to enqueue. |
| instanceBuffer | the instance buffer referenced by the draw command buffer. |
| buffers | buffers required by the shaders used in the draw command buffer. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Record the commands to draw the contents of a draw command buffer using a set of shader buffers to the current viewport region of the render targets.
| drawCommandBuffer | the buffer of draw commands to enqueue. |
| buffers | buffers required by the shaders used in the draw command buffer. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Record the commands to draw the contents of a draw command buffer using a set of shader buffers to the current viewport region of the render targets.
| drawCommandBufferHandle | handle to the buffer of draw commands to enqueue. |
| instanceBufferHandle | handle to the instance buffer referenced by the draw command buffer, or nullptr if the draw command buffer does not have a corresponding instance buffer. |
| bufferHandles | mapping from unique buffer layout references to handles to the buffers required by the shaders used in the draw command buffer, sorted by the first element of the pair. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Record the commands to draw the contents of a draw command buffer with specific shaders using a set of shader buffers to the current viewport region of the render targets.
| shaderPipelineOverride | shader pipeline override to use. |
| drawCommandBuffer | the buffer of draw commands to enqueue. |
| instanceBuffer | the instance buffer referenced by the draw command buffer. |
| buffers | buffers required by the shaders used in the draw command buffer. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Record the commands to draw the contents of a draw command buffer with specific shaders using a set of shader buffers to the current viewport region of the render targets.
| shaderPipelineOverride | shader pipeline override to use. |
| drawCommandBuffer | the buffer of draw commands to enqueue. |
| buffers | buffers required by the shaders used in the draw command buffer. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| RenderPass & grem::graphics::RenderPass::drawShaded | ( | SharedPointer< ShaderPipelineImplementation > | shaderPipelineOverrideHandle, |
| SharedPointer< DrawCommandBufferImplementation > | drawCommandBufferHandle, | ||
| SharedPointer< InstanceBufferImplementation > | instanceBufferHandle, | ||
| Span< const Pair< BufferLayoutReference, SharedPointer< void > > > | bufferHandles ) |
Record a command to draw the contents of a draw command buffer with specific shaders using a set of shader buffers to the current viewport region of the render targets.
| shaderPipelineOverrideHandle | handle to the shader pipeline override to use, or nullptr to not use a shader override. Must use the same mesh type as the draw command buffer if set. |
| drawCommandBufferHandle | handle to the buffer of draw commands to enqueue. |
| instanceBufferHandle | handle to the instance buffer referenced by the draw command buffer, or nullptr if the draw command buffer does not have a corresponding instance buffer. |
| bufferHandles | mapping from unique buffer layout references to handles to the buffers required by the shaders used in the draw command buffer, sorted by the first element of the pair. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Record the commands to draw the contents of an unordered draw command buffer using a set of shader buffers to the current viewport region of the render targets.
| drawCommandBuffer | the buffer of draw commands to enqueue. |
| instanceBuffer | the instance buffer referenced by the draw command buffer. |
| buffers | buffers required by the shaders used in the draw command buffer. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Record the commands to draw the contents of an unordered draw command buffer using a set of shader buffers to the current viewport region of the render targets.
| drawCommandBuffer | the buffer of draw commands to enqueue. |
| buffers | buffers required by the shaders used in the draw command buffer. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Record the commands to draw the contents of an unordered draw command buffer using a set of shader buffers to the current viewport region of the render targets.
| drawCommandBufferHandle | handle to the unordered buffer of draw commands to enqueue. |
| instanceBufferHandle | handle to the instance buffer referenced by the draw command buffer, or nullptr if the draw command buffer does not have a corresponding instance buffer. |
| bufferHandles | mapping from unique buffer layout references to handles to the buffers required by the shaders used in the draw command buffer, sorted by the first element of the pair. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Record the commands to draw the contents of an unordered draw command buffer with specific shaders using a set of shader buffers to the current viewport region of the render targets.
| shaderPipelineOverride | shader pipeline override to use. |
| drawCommandBuffer | the buffer of draw commands to enqueue. |
| instanceBuffer | the instance buffer referenced by the draw command buffer. |
| buffers | buffers required by the shaders used in the draw command buffer. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Record the commands to draw the contents of an unordered draw command buffer with specific shaders using a set of shader buffers to the current viewport region of the render targets.
| shaderPipelineOverride | shader pipeline override to use. |
| drawCommandBuffer | the buffer of draw commands to enqueue. |
| buffers | buffers required by the shaders used in the draw command buffer. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| RenderPass & grem::graphics::RenderPass::drawShadedUnordered | ( | SharedPointer< ShaderPipelineImplementation > | shaderPipelineOverrideHandle, |
| SharedPointer< UnorderedDrawCommandBufferImplementation > | drawCommandBufferHandle, | ||
| SharedPointer< InstanceBufferImplementation > | instanceBufferHandle, | ||
| Span< const Pair< BufferLayoutReference, SharedPointer< void > > > | bufferHandles ) |
Record the commands to draw the contents of an unordered draw command buffer with specific shaders using a set of shader buffers to the current viewport region of the render targets.
| shaderPipelineOverrideHandle | handle to the shader pipeline override to use, or nullptr to not use a shader override. Must use the same mesh type as the draw command buffer if set. |
| drawCommandBufferHandle | handle to the unordered buffer of draw commands to enqueue. |
| instanceBufferHandle | handle to the instance buffer referenced by the draw command buffer, or nullptr if the draw command buffer does not have a corresponding instance buffer. |
| bufferHandles | mapping from unique buffer layout references to handles to the buffers required by the shaders used in the draw command buffer, sorted by the first element of the pair. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
nodiscard |
Get the current statistics of the render pass.
|
inlinenodiscard |
Get a lock for the underlying resource implementation.
|
inlinenodiscardnoexcept |
Get a pointer to the underlying resource implementation.
|
inlinenodiscardnoexcept |
Get a pointer to the underlying resource implementation.