From c60de7051dad8ba591e3b4131902d2323f6fe41a Mon Sep 17 00:00:00 2001 From: Cort Date: Sat, 5 Aug 2017 16:32:14 -0700 Subject: [PATCH] layers: Fix swapchain extent check This fixes a regression introduced -- by me :( -- in commit 583b0c41dfd0876d0481920f2e6d8d87433bc1d7. The swapchain's imageExtent must always be within the surface's min/max extent, regardless of the surface's current extent. --- layers/core_validation.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index eaadcbf7..2446033b 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -8888,11 +8888,10 @@ static bool PreCallValidateCreateSwapchainKHR(layer_data *dev_data, const char * } // Validate pCreateInfo->imageExtent against VkSurfaceCapabilitiesKHR::{current|min|max}ImageExtent: - if ((capabilities.currentExtent.width == kSurfaceSizeFromSwapchain) && - ((pCreateInfo->imageExtent.width < capabilities.minImageExtent.width) || - (pCreateInfo->imageExtent.width > capabilities.maxImageExtent.width) || - (pCreateInfo->imageExtent.height < capabilities.minImageExtent.height) || - (pCreateInfo->imageExtent.height > capabilities.maxImageExtent.height))) { + if ((pCreateInfo->imageExtent.width < capabilities.minImageExtent.width) || + (pCreateInfo->imageExtent.width > capabilities.maxImageExtent.width) || + (pCreateInfo->imageExtent.height < capabilities.minImageExtent.height) || + (pCreateInfo->imageExtent.height > capabilities.maxImageExtent.height)) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_146009f4, "DS", "%s called with imageExtent = (%d,%d), which is outside the bounds returned by " -- 2.34.1