Allocating, recording, and submitting commands
Command buffers are allocated from command pools using the vkAllocateCommandBuffers
function. Command buffers must be initialized with the vkBeginCommandBuffer
function before being recorded into the buffer and prepared for submission with vkEndCommandBuffer
. Commands are recorded into the buffer between those function calls and are executed only after the command buffer is submitted to the device with vkQueueSubmit
.
In this recipe, you will learn how to allocate command buffers, how to record commands in the command buffer, and how to submit them for execution on the GPU.
Getting ready
Command buffers are allocated from the VulkanCore::CommandQueueManager
class and submitted using the same class. VulkanCore::CommandQueueManager
provides basic functions to maintain a set of command buffers for processing.
How to do it…
A command buffer’s life cycle starts with its allocation from a command pool. Once it has...