From d3a0d560716d068ecf6c3977f5eb4795850f3feb Mon Sep 17 00:00:00 2001 From: bailwillharr Date: Sat, 1 Oct 2022 14:57:14 +0100 Subject: [PATCH] Tidy up code --- src/gfx_device_vulkan.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gfx_device_vulkan.cpp b/src/gfx_device_vulkan.cpp index f1d1002..965d1e9 100644 --- a/src/gfx_device_vulkan.cpp +++ b/src/gfx_device_vulkan.cpp @@ -492,11 +492,12 @@ namespace engine::gfx { queueCreateInfos.push_back(queueCreateInfo); } - VkBool32 supported; - res = vkGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, graphicsFamilyIndex.value(), m_surface->getHandle(), &supported); + // check the physical device is compatible with the surface + VkBool32 graphicsQueueCanPresent; + res = vkGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, graphicsFamilyIndex.value(), m_surface->getHandle(), &graphicsQueueCanPresent); assert(res == VK_SUCCESS); - if (supported != VK_TRUE) { - throw std::runtime_error("The selected physical device and queue family do not support this surface"); + if (graphicsQueueCanPresent != VK_TRUE) { + throw std::runtime_error("The selected queue family does not support this surface"); } VkDeviceCreateInfo deviceCreateInfo{