Ending a command buffer recording operation
When we don't want to record any more commands in a command buffer, we need to stop recording it.
How to do it...
- Take the handle of a command buffer that is in a recording state (for which a recording operation was started). Store the handle in a variable of type
VkCommandBuffer
namedcommand_buffer
. - Call
vkEndCommandBuffer( command_buffer )
and provide thecommand_buffer
variable. - Make sure the recording operation was successful by checking whether the call returned a
VK_SUCCESS
value.
How it works...
Commands are recorded into the command buffer between the vkBeginCommandBuffer()
and vkEndCommandBuffer()
function calls. We can't submit a command buffer until we stop recording it. In other words, when we finish recording a command buffer, it is said to be in the executable state and can be submitted.
For the recording operation to be as fast as possible and to have as small impact on the performance as possible, recorded commands don't report any errors...