it should be updated as following.
int i = 0;
for (const auto& queueFamily : queue_families) {
if (queueFamily.queueFlags & VK_QUEUE_GRAPHICS_BIT) {
indices.graphics_family = i;
}
if (queueFamily.queueFlags & VK_QUEUE_COMPUTE_BIT) {
indices.compute_family = i;
}
if (queueFamily.queueFlags & VK_QUEUE_TRANSFER_BIT) {
indices.transfer_family = i;
}
if (indices.is_complete()) {
break;
}
i++;
}
it should be updated as following.