From f9ca0b86a8b317e254c432a1c9f5ea254310667b Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Thu, 18 Feb 2016 20:06:40 -0600 Subject: [PATCH] Query to see if the physical device supports a swapchain surface to silence a validation layer error. --- src/xenia/ui/vulkan/vulkan_swap_chain.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/xenia/ui/vulkan/vulkan_swap_chain.cc b/src/xenia/ui/vulkan/vulkan_swap_chain.cc index 47d246d18..15d2795fd 100644 --- a/src/xenia/ui/vulkan/vulkan_swap_chain.cc +++ b/src/xenia/ui/vulkan/vulkan_swap_chain.cc @@ -37,9 +37,15 @@ VulkanSwapChain::~VulkanSwapChain() { Shutdown(); } bool VulkanSwapChain::Initialize(VkSurfaceKHR surface) { surface_ = surface; + VkBool32 surface_supported = false; + auto err = vkGetPhysicalDeviceSurfaceSupportKHR( + *device_, device_->queue_family_index(), surface, &surface_supported); + assert_true(surface_supported); + CheckResult(err, "vkGetPhysicalDeviceSurfaceSupportKHR"); + // Query supported target formats. uint32_t count = 0; - auto err = + err = vkGetPhysicalDeviceSurfaceFormatsKHR(*device_, surface_, &count, nullptr); CheckResult(err, "vkGetPhysicalDeviceSurfaceFormatsKHR"); std::vector surface_formats;