src/core/VulkanDevice.cpp
VkCommandPool VulkanDevice::createCommandPool(uint32_t queueFamilyIndex, VkCommandPoolCreateFlags createFlags) {
    VkCommandPoolCreateInfo cmdPoolInfo = {};
    cmdPoolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
    cmdPoolInfo.queueFamilyIndex = queueFamilyIndex;
    cmdPoolInfo.flags = createFlags;
    VkCommandPool cmdPool;
    VkResult result = vkCreateCommandPool(logicalDevice, &cmdPoolInfo, nullptr, &cmdPool);
    if (result != VK_SUCCESS)
        throw std::runtime_error("Failed to create command pool");

    return cmdPool;
}
/**
* Create a command pool for allocation command buffers from
*
* @param queueFamilyIndex Family index of the queue to create the command pool for
* @param createFlags (Optional) Command pool creation flags (Defaults to VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT)
*
* @note Command buffers allocated from the created pool can only be submitted to a queue with the same family index
*
* @return A handle to the created command buffer
*/
Create a command pool for allocation command buffers from
Create a command pool for allocation command buffers from
VkCommandPool VulkanDevice::createCommandPool(uint32_t queueFamilyIndex, VkCommandPoolCreateFlags createFlags) {
    VkCommandPoolCreateInfo cmdPoolInfo = {};
    cmdPoolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
    cmdPoolInfo.queueFamilyIndex = queueFamilyIndex;
    cmdPoolInfo.flags = createFlags;
    VkCommandPool cmdPool;
    VkResult result = vkCreateCommandPool(logicalDevice, &cmdPoolInfo, nullptr, &cmdPool);
    if (result != VK_SUCCESS)
        throw std::runtime_error("Failed to create command pool");
    return cmdPool;
}
VkCommandPool VulkanDevice :: createCommandPool ( uint32_t queueFamilyIndex , VkCommandPoolCreateFlags createFlags ) { VkCommandPoolCreateInfo cmdPoolInfo = { } ; cmdPoolInfo . sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO ; cmdPoolInfo . queueFamilyIndex = queueFamilyIndex ; cmdPoolInfo . flags = createFlags ; VkCommandPool cmdPool ; VkResult result = vkCreateCommandPool ( logicalDevice , & cmdPoolInfo , nullptr , & cmdPool ) ; if ( result != VK_SUCCESS ) throw std :: runtime_error ( " " ) ; return cmdPool ; }
Create a command pool for allocation command buffers from
Create a command pool for allocation command buffers from