From 9339090d32723ab94feacbfd6056a33e43672341 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 18 Sep 2017 23:39:12 -0700 Subject: [PATCH] fix assert on window resize --- src/vulkan_icd/x11_wsi.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/vulkan_icd/x11_wsi.cpp b/src/vulkan_icd/x11_wsi.cpp index 08c7e6b..82c76ee 100644 --- a/src/vulkan_icd/x11_wsi.cpp +++ b/src/vulkan_icd/x11_wsi.cpp @@ -520,8 +520,6 @@ struct Xcb_wsi::Implementation #warning formats other than VK_FORMAT_B8G8R8A8_UNORM are unimplemented assert(create_info.imageFormat == VK_FORMAT_B8G8R8A8_UNORM); assert(create_info.imageColorSpace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR); - assert(create_info.imageExtent.width == start_setup_results.image_width); - assert(create_info.imageExtent.height == start_setup_results.image_height); assert(create_info.imageArrayLayers <= start_setup_results.capabilities.maxImageArrayLayers); assert(create_info.imageArrayLayers != 0); @@ -540,6 +538,11 @@ struct Xcb_wsi::Implementation case Start_setup_results::Status::Success: break; } + if(start_setup_results.image_width != create_info.imageExtent.width + || start_setup_results.image_height != create_info.imageExtent.height) + { + status = Status::Out_of_date; + } start_setup_results.image_descriptor.format = create_info.imageFormat; swapchain_width = start_setup_results.image_width; swapchain_height = start_setup_results.image_height; @@ -748,7 +751,7 @@ struct Xcb_wsi::Implementation queue.queue_fence_signal(fence); fence.wait(-1); } - + if(shm_is_supported) { xcb_copy_area(connection, @@ -916,10 +919,10 @@ util::variant> Xcb_wsi::create_swapc switch(swapchain->status) { case Implementation::Swapchain::Status::Setup_failed: - case Implementation::Swapchain::Status::Out_of_date: case Implementation::Swapchain::Status::No_surface: return VK_ERROR_SURFACE_LOST_KHR; case Implementation::Swapchain::Status::Good: + case Implementation::Swapchain::Status::Out_of_date: // we'll return out of date later return swapchain; } assert(!"unreachable"); -- 2.30.2