In Vulkan we can record two types of command buffers--primary and secondary. Primary command buffers can be submitted to queues directly. Secondary command buffers can be executed only from within primary command buffers.
Executing a secondary command buffer inside a primary command buffer
How to do it...
- Take a command buffer's handle. Store it in a variable of type VkCommandBuffer named command_buffer. Make sure the command buffer is in the recording state.
- Prepare a variable of type std::vector<VkCommandBuffer> named secondary_command_buffers containing secondary command buffers that should be executed from within the command_buffer.
- Record the following command: vkCmdExecuteCommands( command_buffer, static_cast<uint32_t>(secondary_command_buffers...