Skip to content

LiteFX::Rendering::CommandQueue::createCommandBuffer

Creates a command buffer that can be used to allocate commands on the queue.

Synopsis

Declared in <litefx/rendering.hpp>

virtual SharedPtr<command_buffer_type> createCommandBuffer(
    bool beginRecording = false,
    bool secondary = false) const = 0;

Description

Specifying secondary allows to create secondary command buffers (aka. bundles). Those are intended to be used as efficient pre-recorded command buffers that are re-used multiple times. Using such a command buffer allows drivers to pre-apply optimizations, which causes a one-time cost during setup, but reduces cost when re- applying the command buffer multiple times. Ideally they are used as small chunks of re-occurring workloads.

A secondary command buffer must not be submitted to a queue, but rather to a primary command buffer by calling ICommandBuffer::execute.

Return Value

The instance of the command buffer.

Parameters

NameDescription
beginRecordingIf set to true, the command buffer will be initialized in recording state and can receive commands straight away.
secondaryIf set to true, the method will create a secondary command buffer/bundle.