Tidy up code

This commit is contained in:
Bailey Harrison 2022-10-01 14:57:14 +01:00
parent bf989e55c6
commit d3a0d56071

View File

@ -492,11 +492,12 @@ namespace engine::gfx {
queueCreateInfos.push_back(queueCreateInfo); queueCreateInfos.push_back(queueCreateInfo);
} }
VkBool32 supported; // check the physical device is compatible with the surface
res = vkGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, graphicsFamilyIndex.value(), m_surface->getHandle(), &supported); VkBool32 graphicsQueueCanPresent;
res = vkGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, graphicsFamilyIndex.value(), m_surface->getHandle(), &graphicsQueueCanPresent);
assert(res == VK_SUCCESS); assert(res == VK_SUCCESS);
if (supported != VK_TRUE) { if (graphicsQueueCanPresent != VK_TRUE) {
throw std::runtime_error("The selected physical device and queue family do not support this surface"); throw std::runtime_error("The selected queue family does not support this surface");
} }
VkDeviceCreateInfo deviceCreateInfo{ VkDeviceCreateInfo deviceCreateInfo{