VulkanContext: Ensure present queue family is valid before incrementing queueCreateInfoCount

This commit is contained in:
OatmealDome 2021-12-28 21:18:47 -05:00
parent 2ab331dcdf
commit 9ff7f80aa0
1 changed files with 2 additions and 1 deletions

View File

@ -628,7 +628,8 @@ bool VulkanContext::CreateDevice(VkSurfaceKHR surface, bool enable_validation_la
}};
device_info.queueCreateInfoCount = 1;
if (m_graphics_queue_family_index != m_present_queue_family_index)
if (m_graphics_queue_family_index != m_present_queue_family_index &&
m_present_queue_family_index != queue_family_count)
{
device_info.queueCreateInfoCount = 2;
}