GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::RenderPass Class Reference

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.

Detailed Description

Backend-specific implementation of RenderPass.

List of draw commands to be rendered onto a set of render targets using a Device.

Constructor & Destructor Documentation

◆ RenderPass() [1/6]

grem::graphics::RenderPass::RenderPass ( Device & device,
Span< const TextureSubresourceReference > renderTargets,
const ClearMode & clearMode,
Optional< Viewport > viewport = {} )

Construct a render pass.

Parameters
devicedevice to create the render pass for. Must outlive the render pass.
renderTargetsset 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.
clearModeone of RetainValues, ClearValues or UndefinedClearValues, specifying whether/how to retain/clear the render target contents at the beginning of the render pass.
viewportinitial viewport to use for subsequently recorded draw commands, or an empty optional to choose a default viewport that fits the render targets.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
The referenced render targets must remain valid for as long as the render pass is used for rendering.
Note
Using UndefinedClearValues may allow for optimizations in the graphics backend, since a new renderbuffer can be allocated without copying any old values. This is useful in cases where the initial render target contents do not matter for the render pass, such as when the draw commands will completely overwrite the entire framebuffer.

◆ RenderPass() [2/6]

GREM_ALWAYS_INLINE grem::graphics::RenderPass::RenderPass ( Device & device,
TextureSubresourceReference renderTarget,
const ClearMode & clearMode,
Optional< Viewport > viewport = {} )
inline

Construct a render pass.

Parameters
devicedevice to create the render pass for. Must outlive the render pass.
renderTargetrender target to render to, whose 2D size must fit in device.getSupportedFeatures().maxFramebufferSize.
clearModeone of RetainValues, ClearValues or UndefinedClearValues, specifying whether/how to retain/clear the render target contents at the beginning of the render pass.
viewportinitial viewport to use for subsequently recorded draw commands, or an empty optional to choose a default viewport that fits the render target.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
The referenced render target must remain valid for as long as the render pass is used for rendering.
Note
Using UndefinedClearValues may allow for optimizations in the graphics backend, since a new renderbuffer can be allocated without copying any old values. This is useful in cases where the initial render target contents do not matter for the render pass, such as when the draw commands will completely overwrite the entire framebuffer.

◆ RenderPass() [3/6]

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.

Parameters
devicedevice to create the render pass for. Must outlive the render pass.
resolveTargetresolve target to resolve the color target to at the end of each render. Must have the color texture aspect. Must not be multisampled.
resolveModeone 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.
renderTargetsset 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.
clearModeone of RetainValues, ClearValues or UndefinedClearValues, specifying whether/how to retain/clear the render target contents at the beginning of the render pass.
viewportinitial viewport to use for subsequently recorded draw commands, or an empty optional to choose a default viewport that fits the render targets.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
The referenced resolve target and render targets must remain valid for as long as the render pass is used for rendering.

◆ RenderPass() [4/6]

GREM_ALWAYS_INLINE grem::graphics::RenderPass::RenderPass ( Device & device,
TextureSubresourceReference resolveTarget,
const ResolveMode & resolveMode,
TextureSubresourceReference renderTarget,
const ClearMode & clearMode,
Optional< Viewport > viewport = {} )
inline

Construct a multisampled render pass that resolves to a resolve target at the end of the render.

Parameters
devicedevice to create the render pass for. Must outlive the render pass.
resolveTargetresolve target to resolve the color target to at the end of each render. Must have the color texture aspect. Must not be multisampled.
resolveModeone 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.
renderTargetrender target to render to, whose 2D size must fit in device.getSupportedFeatures().maxFramebufferSize. Must be multisampled. Must have the color texture aspect.
clearModeone of RetainValues, ClearValues or UndefinedClearValues, specifying whether/how to retain/clear the render target contents at the beginning of the render pass.
viewportinitial viewport to use for subsequently recorded draw commands, or an empty optional to choose a default viewport that fits the render target.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
The referenced render target must remain valid for as long as the render pass is used for rendering.

◆ ~RenderPass()

grem::graphics::RenderPass::~RenderPass ( )

Destructor.

◆ RenderPass() [5/6]

grem::graphics::RenderPass::RenderPass ( const RenderPass & )
delete

Copying a render pass is not allowed.

◆ RenderPass() [6/6]

grem::graphics::RenderPass::RenderPass ( RenderPass && )
delete

Moving a render pass is not allowed.

Member Function Documentation

◆ operator=() [1/2]

RenderPass & grem::graphics::RenderPass::operator= ( const RenderPass & )
delete

Copying a render pass is not allowed.

◆ operator=() [2/2]

RenderPass & grem::graphics::RenderPass::operator= ( RenderPass && )
delete

Moving a render pass is not allowed.

◆ setViewport()

RenderPass & grem::graphics::RenderPass::setViewport ( const Viewport & viewport)

Set the viewport and scissor area to use for subsequently recorded draw commands.

Parameters
viewportregion of the render targets to render to.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.

◆ setViewportScissor()

RenderPass & grem::graphics::RenderPass::setViewportScissor ( const Optional< Region2D > & scissor)

Set the scissor area to use for subsequently recoreded draw commands.

Parameters
scissorrectangular region outside of which any attempts to render a pixel will be discarded, or an empty optional to use the full viewport area.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Note
The scissor area will be reset on the next viewport change.
See also
setViewport()

◆ getViewport()

const Viewport & grem::graphics::RenderPass::getViewport ( )
nodiscard

Get the viewport that will be used for subsequently recorded draw commands.

Returns
a read-only reference to the current viewport, valid until the next non-const member function call on the render pass, or until the render pass is destroyed, whichever happens first.

◆ getFramebufferSize()

Extent2D grem::graphics::RenderPass::getFramebufferSize ( )
nodiscard

Get the size of the framebuffer that the render pass will be rendering through.

Returns
the framebuffer size of the render pass.

◆ fill() [1/2]

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.

Parameters
targetRegionrectangular area of the render targets to fill. Must be a valid region of the render targets.
valuesvalues to fill the specified render target aspects with.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.

◆ fill() [2/2]

RenderPass & grem::graphics::RenderPass::fill ( const ClearValues & values)
inline

Record a command to fill the full contents of the render targets.

Parameters
valuesvalues to fill the specified render target aspects with.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.

◆ draw() [1/3]

template<typename Vertex, typename Index, typename Parameters, typename Instance, typename... Buffers>
RenderPass & grem::graphics::RenderPass::draw ( const DrawCommandBuffer< Mesh< Vertex, Index, Parameters, Instance > > & drawCommandBuffer,
const InstanceBuffer< Instance > & instanceBuffer,
const Buffers &... buffers )
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.

Parameters
drawCommandBufferthe buffer of draw commands to enqueue.
instanceBufferthe instance buffer referenced by the draw command buffer.
buffersbuffers required by the shaders used in the draw command buffer.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
All instance buffer ranges specified by the draw command buffer must be valid ranges of instances in the given instance buffer.
All buffers required by the shaders used in the draw command buffer must be provided through the parameter pack.

◆ draw() [2/3]

template<typename Vertex, typename Index, typename Parameters, typename... Buffers>
RenderPass & grem::graphics::RenderPass::draw ( const DrawCommandBuffer< Mesh< Vertex, Index, Parameters, NoInstance > > & drawCommandBuffer,
const Buffers &... buffers )
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.

Parameters
drawCommandBufferthe buffer of draw commands to enqueue.
buffersbuffers required by the shaders used in the draw command buffer.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
All buffers required by the shaders used in the draw command buffer must be provided through the parameter pack.

◆ draw() [3/3]

RenderPass & grem::graphics::RenderPass::draw ( SharedPointer< DrawCommandBufferImplementation > drawCommandBufferHandle,
SharedPointer< InstanceBufferImplementation > instanceBufferHandle,
Span< const Pair< BufferLayoutReference, SharedPointer< void > > > bufferHandles )
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.

Parameters
drawCommandBufferHandlehandle to the buffer of draw commands to enqueue.
instanceBufferHandlehandle to the instance buffer referenced by the draw command buffer, or nullptr if the draw command buffer does not have a corresponding instance buffer.
bufferHandlesmapping 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.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
All instance buffer ranges specified by the draw command buffer must be valid ranges of instances in the given instance buffer.
All buffers required by the shaders used in the draw command buffer must be provided through the buffer handles.
All buffer layout references must be acquired using Buffer::LAYOUT_REFERENCE.

◆ drawShaded() [1/3]

template<typename Vertex, typename Index, typename Parameters, typename Instance, typename... Buffers>
RenderPass & grem::graphics::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 )
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.

Parameters
shaderPipelineOverrideshader pipeline override to use.
drawCommandBufferthe buffer of draw commands to enqueue.
instanceBufferthe instance buffer referenced by the draw command buffer.
buffersbuffers required by the shaders used in the draw command buffer.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
All instance buffer ranges specified by the draw command buffer must be valid ranges of instances in the given instance buffer.
All buffers required by the shaders used in the draw command buffer must be provided through the parameter pack.

◆ drawShaded() [2/3]

template<typename Vertex, typename Index, typename Parameters, typename... Buffers>
RenderPass & grem::graphics::RenderPass::drawShaded ( const ShaderPipeline< Mesh< Vertex, Index, Parameters, NoInstance > > & shaderPipelineOverride,
const DrawCommandBuffer< Mesh< Vertex, Index, Parameters, NoInstance > > & drawCommandBuffer,
const Buffers &... buffers )
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.

Parameters
shaderPipelineOverrideshader pipeline override to use.
drawCommandBufferthe buffer of draw commands to enqueue.
buffersbuffers required by the shaders used in the draw command buffer.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
All buffers required by the shaders used in the draw command buffer must be provided through the parameter pack.

◆ drawShaded() [3/3]

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.

Parameters
shaderPipelineOverrideHandlehandle 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.
drawCommandBufferHandlehandle to the buffer of draw commands to enqueue.
instanceBufferHandlehandle to the instance buffer referenced by the draw command buffer, or nullptr if the draw command buffer does not have a corresponding instance buffer.
bufferHandlesmapping 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.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
All instance buffer ranges specified by the draw command buffer must be valid ranges of instances in the given instance buffer.
All buffers required by the shaders used in the draw command buffer must be provided through the buffer handles.
All buffer layout references must be acquired using Buffer::LAYOUT_REFERENCE.

◆ drawUnordered() [1/3]

template<typename Vertex, typename Index, typename Parameters, typename Instance, typename... Buffers>
RenderPass & grem::graphics::RenderPass::drawUnordered ( const UnorderedDrawCommandBuffer< Mesh< Vertex, Index, Parameters, Instance > > & drawCommandBuffer,
const InstanceBuffer< Instance > & instanceBuffer,
const Buffers &... buffers )
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.

Parameters
drawCommandBufferthe buffer of draw commands to enqueue.
instanceBufferthe instance buffer referenced by the draw command buffer.
buffersbuffers required by the shaders used in the draw command buffer.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
All instance buffer ranges specified by the draw command buffer must be valid ranges of instances in the given instance buffer.
All buffers required by the shaders used in the draw command buffer must be provided through the parameter pack.

◆ drawUnordered() [2/3]

template<typename Vertex, typename Index, typename Parameters, typename... Buffers>
RenderPass & grem::graphics::RenderPass::drawUnordered ( const UnorderedDrawCommandBuffer< Mesh< Vertex, Index, Parameters, NoInstance > > & drawCommandBuffer,
const Buffers &... buffers )
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.

Parameters
drawCommandBufferthe buffer of draw commands to enqueue.
buffersbuffers required by the shaders used in the draw command buffer.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
All buffers required by the shaders used in the draw command buffer must be provided through the parameter pack.

◆ drawUnordered() [3/3]

RenderPass & grem::graphics::RenderPass::drawUnordered ( SharedPointer< UnorderedDrawCommandBufferImplementation > drawCommandBufferHandle,
SharedPointer< InstanceBufferImplementation > instanceBufferHandle,
Span< const Pair< BufferLayoutReference, SharedPointer< void > > > bufferHandles )
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.

Parameters
drawCommandBufferHandlehandle to the unordered buffer of draw commands to enqueue.
instanceBufferHandlehandle to the instance buffer referenced by the draw command buffer, or nullptr if the draw command buffer does not have a corresponding instance buffer.
bufferHandlesmapping 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.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
All instance buffer ranges specified by the draw command buffer must be valid ranges of instances in the given instance buffer.
All buffers required by the shaders used in the draw command buffer must be provided through the buffer handles.
All buffer layout references must be acquired using Buffer::LAYOUT_REFERENCE.

◆ drawShadedUnordered() [1/3]

template<typename Vertex, typename Index, typename Parameters, typename Instance, typename... Buffers>
RenderPass & grem::graphics::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 )
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.

Parameters
shaderPipelineOverrideshader pipeline override to use.
drawCommandBufferthe buffer of draw commands to enqueue.
instanceBufferthe instance buffer referenced by the draw command buffer.
buffersbuffers required by the shaders used in the draw command buffer.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
All instance buffer ranges specified by the draw command buffer must be valid ranges of instances in the given instance buffer.
All buffers required by the shaders used in the draw command buffer must be provided through the parameter pack.

◆ drawShadedUnordered() [2/3]

template<typename Vertex, typename Index, typename Parameters, typename... Buffers>
RenderPass & grem::graphics::RenderPass::drawShadedUnordered ( const ShaderPipeline< Mesh< Vertex, Index, Parameters, NoInstance > > & shaderPipelineOverride,
const UnorderedDrawCommandBuffer< Mesh< Vertex, Index, Parameters, NoInstance > > & drawCommandBuffer,
const Buffers &... buffers )
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.

Parameters
shaderPipelineOverrideshader pipeline override to use.
drawCommandBufferthe buffer of draw commands to enqueue.
buffersbuffers required by the shaders used in the draw command buffer.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
All buffers required by the shaders used in the draw command buffer must be provided through the parameter pack.

◆ drawShadedUnordered() [3/3]

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.

Parameters
shaderPipelineOverrideHandlehandle 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.
drawCommandBufferHandlehandle to the unordered buffer of draw commands to enqueue.
instanceBufferHandlehandle to the instance buffer referenced by the draw command buffer, or nullptr if the draw command buffer does not have a corresponding instance buffer.
bufferHandlesmapping 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.
Returns
*this, for chaining.
Exceptions
graphics::Errorif resource creation failed.
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.
Warning
All instance buffer ranges specified by the draw command buffer must be valid ranges of instances in the given instance buffer.
All buffers required by the shaders used in the draw command buffer must be provided through the buffer handles.
All buffer layout references must be acquired using Buffer::LAYOUT_REFERENCE.

◆ getStatistics()

Statistics grem::graphics::RenderPass::getStatistics ( ) const
nodiscard

Get the current statistics of the render pass.

◆ lock()

SharedPointer< RenderPassImplementation > grem::graphics::RenderPass::lock ( ) const
inlinenodiscard

Get a lock for the underlying resource implementation.

Returns
a shared resource handle to the underlying resource.
Note
The type of the returned resource is backend-specific and has no meaning to application code.

◆ get() [1/2]

RenderPassImplementation * grem::graphics::RenderPass::get ( )
inlinenodiscardnoexcept

Get a pointer to the underlying resource implementation.

Returns
a non-owning pointer to the underlying resource.
Note
The type of the returned resource is backend-specific and has no meaning to application code.

◆ get() [2/2]

const RenderPassImplementation * grem::graphics::RenderPass::get ( ) const
inlinenodiscardnoexcept

Get a pointer to the underlying resource implementation.

Returns
a non-owning read-only pointer to the underlying resource.
Note
The type of the returned resource is backend-specific and has no meaning to application code.

The documentation for this class was generated from the following file: