Creating a command pool
Command pools are objects from which command buffers acquire their memory. Memory itself is allocated implicitly and dynamically, but without it command buffers wouldn't have any storage space to hold the recorded commands. That's why, before we can allocate command buffers, we first need to create a memory pool for them.
How to do it...
- Create a variable of type
VkDevicenamedlogical_deviceand initialize it with a handle of a created logical device.
- Take the index of one of the queue families requested for the logical device. Store this index in a variable of type
uint32_tnamedqueue_family. - Create a variable of type
VkCommandPoolCreateInfonamedcommand_pool_create_info. Use the following values for the members of this variable:VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFOvalue forsTypenullptrvalue forpNext- Bit field indicating selected parameters of type
VkCommandPoolCreateFlagsforflags queue_familyvariable forqueueFamilyIndex
- Create a variable of type
VkCommandPool...