A secondary command buffer must not be directly submitted to a queue. Instead, secondary command buffers are recorded to execute as part of a primary command buffer with the command:
void vkCmdExecuteCommands( VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers);
commandBuffer
is a handle to a primary command buffer that the
secondary command buffers are executed in.
commandBufferCount
is the length of the pCommandBuffers
array.
pCommandBuffers
is an array of secondary command buffer handles,
which are recorded to execute in the primary command buffer in the order
they are listed in the array.
Once vkCmdExecuteCommands
has been called, any prior executions of the
secondary command buffers specified by pCommandBuffers
in any other
primary command buffer become invalidated, unless those secondary command
buffers were recorded with
VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT
.