From a6eb629273ca43dfadc2295a8c18b5b46761028c Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 9 Dec 2016 10:39:26 +1300 Subject: layers: Track whether a swapchain has been replaced If a swapchain is used as VkSwapchainCreateInfoKHR::oldSwapchain, then it is replaced. This occurs even if the new swapchain creation fails. Signed-off-by: Chris Forbes --- layers/core_validation.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 6992041a..7d79e2c6 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -11984,6 +11984,9 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSwapchainKHR(VkDevice device, const VkSwapc } // Spec requires that even if CreateSwapchainKHR fails, oldSwapchain behaves as replaced. + if (old_swapchain_state) { + old_swapchain_state->replaced = true; + } surface_state->old_swapchain = old_swapchain_state; return result; -- cgit v1.2.3