From 9bb5a7ccd009446972c88f4af153c59e0f2eac83 Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Wed, 19 Oct 2022 14:41:50 -0600 Subject: vulkaninfo: Fix validation errors Required checking for surface support of a given physical device as well as adding the correct Image usage for transient images. --- vulkaninfo/vulkaninfo.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vulkaninfo/vulkaninfo.cpp') diff --git a/vulkaninfo/vulkaninfo.cpp b/vulkaninfo/vulkaninfo.cpp index 8574b176..af723207 100644 --- a/vulkaninfo/vulkaninfo.cpp +++ b/vulkaninfo/vulkaninfo.cpp @@ -1103,6 +1103,12 @@ int main(int argc, char **argv) { surface_extension.surface = surface_extension.create_surface(instance); for (auto &phys_device : phys_devices) { try { + // check if the surface is supported by the physical device before adding it to the list + VkBool32 supported = VK_FALSE; + VkResult err = instance.ext_funcs.vkGetPhysicalDeviceSurfaceSupportKHR(phys_device, 0, + surface_extension.surface, &supported); + if (err != VK_SUCCESS || supported == VK_FALSE) continue; + surfaces.push_back(std::unique_ptr(new AppSurface(instance, phys_device, surface_extension))); } catch (std::exception &e) { std::cerr << "ERROR while creating surface for extension " << surface_extension.name << " : " << e.what() -- cgit v1.2.3