LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::RenderPassDescriptor Struct Reference

Render pass descriptor structure. More...

#include <RenderPassFlags.h>

Public Attributes

const char * debugName = nullptr
 Optional name for debugging purposes. By default null.
AttachmentFormatDescriptor colorAttachments [LLGL_MAX_NUM_COLOR_ATTACHMENTS]
 Specifies the color attachments used within the render pass.
AttachmentFormatDescriptor depthAttachment
 Specifies the depth attachment used within the render pass.
AttachmentFormatDescriptor stencilAttachment
 Specifies the stencil attachment used within the render pass.
std::uint32_t samples = 1
 Specifies the number of samples for the respective render target attachment. By default 1.
std::uint32_t views = 1
 Specifies the number of views for multiview (single-pass layered) rendering. By default 1.

Detailed Description

Render pass descriptor structure.

Remarks
A render pass object can be used across multiple render targets. Moreover, a render target can be created with a different render pass object than the one used for CommandBuffer::BeginRenderPass as long as they are compatible. Two render passes are considered compatible when all color-, depth-, and stencil attachments are compatible.
See also
RenderSystem::CreateRenderPass
CommandBuffer::BeginRenderPass
AttachmentFormatDescriptor

Member Data Documentation

◆ colorAttachments

AttachmentFormatDescriptor LLGL::RenderPassDescriptor::colorAttachments[LLGL_MAX_NUM_COLOR_ATTACHMENTS]

Specifies the color attachments used within the render pass.

Remarks
Each attachment with a format field set to Format::Undefined is disabled. Any other attachment after the first disabled attachment is also considered disabled as attachments must be enabled in consecutive order. A swap-chain usually uses a BGRA format instead of an RGBA format.
See also
RenderingLimits::maxColorAttachments
Format::BGRA8UNorm
Format::BGRA8sRGB

◆ debugName

const char* LLGL::RenderPassDescriptor::debugName = nullptr

Optional name for debugging purposes. By default null.

Remarks
The final name of the native hardware resource is implementation defined.
See also
RenderSystemChild::SetDebugName

◆ depthAttachment

AttachmentFormatDescriptor LLGL::RenderPassDescriptor::depthAttachment

Specifies the depth attachment used within the render pass.

Remarks
The depth attachment and stencil attachment usually share the same format (e.g. Format::D24UNormS8UInt). They are separated here to specify different load and store operations.

◆ samples

std::uint32_t LLGL::RenderPassDescriptor::samples = 1

Specifies the number of samples for the respective render target attachment. By default 1.

Remarks
This must be greater than 0. If this is 1, multi-sampling is disabled. All attachments and the respective render target must have the same number of samples.
See also
TextureDescriptor::samples
RenderingLimits::maxColorBufferSamples
RenderingLimits::maxDepthBufferSamples
RenderingLimits::maxStencilBufferSamples
RenderingLimits::maxNoAttachmentSamples

◆ stencilAttachment

AttachmentFormatDescriptor LLGL::RenderPassDescriptor::stencilAttachment

Specifies the stencil attachment used within the render pass.

Remarks
The depth attachment and stencil attachment usually share the same format (e.g. Format::D24UNormS8UInt). They are separated here to specify different load and store operations.

◆ views

std::uint32_t LLGL::RenderPassDescriptor::views = 1

Specifies the number of views for multiview (single-pass layered) rendering. By default 1.

Remarks
If this is greater than 1, the render pass is a multiview render pass: a single draw command is broadcast to views consecutive array layers of the render target, starting at AttachmentDescriptor::arrayLayer. Each invocation can read its layer index via SystemValue::ViewIndex to index per-view data (e.g. view-projection matrices for single-pass stereo or cascaded shadow maps). All render target attachments used with this render pass must be array textures with at least arrayLayer + views layers.
This must not be greater than RenderingLimits::maxViews and requires RenderingFeatures::hasMultiview. A value of 0 is treated the same as 1 (multiview disabled).
Note
Only supported with: Vulkan, Direct3D 12.
See also
RenderingFeatures::hasMultiview
RenderingLimits::maxViews
SystemValue::ViewIndex
AttachmentDescriptor::arrayLayer

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