layers: Fix swapchain extent check
authorCort <cdwfs@users.noreply.github.com>
Sat, 5 Aug 2017 23:32:14 +0000 (16:32 -0700)
committerCort <cdwfs@users.noreply.github.com>
Mon, 7 Aug 2017 17:11:36 +0000 (10:11 -0700)
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

index eaadcbf70ea327337e275660ff44b97e216e9192..2446033b7679635758aec0a18705d94ee7309cc1 100644 (file)
@@ -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 "