diff --git a/src/dawn_native/vulkan/SwapChainVk.cpp b/src/dawn_native/vulkan/SwapChainVk.cpp index ad88c9d6a3..8d0804b013 100644 --- a/src/dawn_native/vulkan/SwapChainVk.cpp +++ b/src/dawn_native/vulkan/SwapChainVk.cpp @@ -463,11 +463,15 @@ namespace dawn_native { namespace vulkan { switch (result) { case VK_SUCCESS: + // VK_SUBOPTIMAL_KHR means "a swapchain no longer matches the surface properties + // exactly, but can still be used to present to the surface successfully", so we + // can also treat it as a "success" error code of vkQueuePresentKHR(). + case VK_SUBOPTIMAL_KHR: return {}; + // This present cannot be recovered. Re-initialize the VkSwapchain so that future + // presents work.. case VK_ERROR_OUT_OF_DATE_KHR: - // This present cannot be recovered. Re-initialize the VkSwapchain so that future - // presents work.. return Initialize(this); // TODO(cwallez@chromium.org): Allow losing the surface at Dawn's API level?