Command buffers are used to store (record) commands that are later submitted to queues, where they are executed and processed by the hardware to give us results. When we have created a command pool, we can use it to allocate command buffers.
Allocating command buffers
How to do it...
- Take the handle of a created logical device and store it in a variable of type VkDevice named logical_device.
- Take the handle of a command pool and use it to initialize a variable of type VkCommandPool named command_pool.
- Create a variable of type VkCommandBufferAllocateInfo named command_buffer_allocate_info and use the following values for its members:
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO value for sType
- nullptr value for pNext
- command_pool variable for commandPool
- VK_COMMAND_BUFFER_LEVEL_PRIMARY...