Skip to content

LiteFX::Rendering::Backends::VulkanQueue::createCommandBuffer

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

Synopsis

Declared in <litefx/backends/vulkan.hpp>

[[dllimport, dllexport]] virtual SharedPtr<VulkanCommandBuffer> createCommandBuffer(bool secondary = false) const override;

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. Note that Vulkan does not forbid secondary command buffers to be created for arbitrary queues, while under DirectX 12, those must be created on a QueueType::Graphics queue. For portable code, refrain from using secondary command buffers on other queue types.

Return Value

The instance of the command buffer.

Parameters

NameDescription
secondaryIf set to true, the method will create a secondary command buffer/bundle.