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

Command buffer descriptor structure. More...

#include <CommandBufferFlags.h>

Public Member Functions

 CommandBufferDescriptor ()=default
 CommandBufferDescriptor (long flags)
 Constructs the command buffer descriptor with the specified flags.
 CommandBufferDescriptor (long flags, std::uint32_t numNativeBuffers)
 Constructs the command buffer descriptor with the specified flags and number of native buffers.

Public Attributes

const char * debugName = nullptr
 Optional name for debugging purposes. By default null.
long flags = 0
 Specifies the creation flags for the command buffer. By default 0.
std::uint32_t numNativeBuffers = 0
 Specifies the number of internal native command buffers. 0 specifies to let the backend decide how many native buffers to allocate. By default 0.
std::uint64_t minStagingPoolSize = (0xFFFF + 1)
 Specifies the minimum size (in bytes) for the staging pool (if supported). By default 65536 (or 0xFFFF + 1).
const RenderPass * renderPass = nullptr
 Optional render pass object for secondary command buffers. By default null.

Detailed Description

Command buffer descriptor structure.

See also
RenderSystem::CreateCommandBuffer

Constructor & Destructor Documentation

◆ CommandBufferDescriptor() [1/3]

LLGL::CommandBufferDescriptor::CommandBufferDescriptor ( )
default

◆ CommandBufferDescriptor() [2/3]

LLGL::CommandBufferDescriptor::CommandBufferDescriptor ( long flags)
inline

Constructs the command buffer descriptor with the specified flags.

◆ CommandBufferDescriptor() [3/3]

LLGL::CommandBufferDescriptor::CommandBufferDescriptor ( long flags,
std::uint32_t numNativeBuffers )
inline

Constructs the command buffer descriptor with the specified flags and number of native buffers.

Member Data Documentation

◆ debugName

const char* LLGL::CommandBufferDescriptor::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

◆ flags

long LLGL::CommandBufferDescriptor::flags = 0

Specifies the creation flags for the command buffer. By default 0.

Remarks
If no flags are specified (i.e. the default value), the command buffer must be encoded again after it has been submitted to the command queue.
See also
CommandBufferFlags

◆ minStagingPoolSize

std::uint64_t LLGL::CommandBufferDescriptor::minStagingPoolSize = (0xFFFF + 1)

Specifies the minimum size (in bytes) for the staging pool (if supported). By default 65536 (or 0xFFFF + 1).

Remarks
This is only a hint to the framework, since not all rendering APIs support command buffers natively. For the D3D12 backend for instance, this will specify the initial buffer size for the staging pool, i.e. for buffer updates during command encoding. For command buffers that will make many and large buffer updates, increase this size to fine-tune performance.
See also
CommandBuffer::UpdateBuffer

◆ numNativeBuffers

std::uint32_t LLGL::CommandBufferDescriptor::numNativeBuffers = 0

Specifies the number of internal native command buffers. 0 specifies to let the backend decide how many native buffers to allocate. By default 0.

Remarks
This is only a hint to the framework, since not all rendering APIs support command buffers natively. For those that do, however, this member specifies how many native command buffers are to be allocated internally. These native command buffers are then switched everytime encoding begins with the CommandBuffer::Begin function. The benefit of having multiple native command buffers is that it reduces the time the GPU is idle because it waits for a command buffer to be completed before it can be reused. For command buffers that are only recorded once and submitted multiple times, it makes sense to allocate only a single native command buffer.
See also
CommandBuffer::Begin

◆ renderPass

const RenderPass* LLGL::CommandBufferDescriptor::renderPass = nullptr

Optional render pass object for secondary command buffers. By default null.

Remarks
Specifies a RenderPass that is used for inheritance information. This allows the command buffer to continue a render pass that was started by a primary command buffer. If this is null, the secondary command buffer must start and end its own render pass section, unless the backend does not natively support render passes. This field is ignored if flags does not include the CommandBufferFlags::Secondary flag.
See also
CommandBufferFlags::Secondary

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