Swapchain: Match validity rules for pCreateInfo->imageUsage.
authorIan Elliott <ianelliott@google.com>
Wed, 20 Jan 2016 13:03:12 +0000 (06:03 -0700)
committerJon Ashburn <jon@lunarg.com>
Thu, 28 Jan 2016 18:18:35 +0000 (11:18 -0700)
Should not check that the value is non-zero, only that it's a subset of the
bits in pCapabilities->supportedUsageFlags.

layers/swapchain.cpp

index 2f02f95..841105f 100644 (file)
@@ -1386,9 +1386,8 @@ static VkBool32 validateCreateSwapchainKHR(
         }
         // Validate pCreateInfo->imageUsage against
         // VkSurfaceCapabilitiesKHR::supportedUsageFlags:
-        if (pCreateInfo->imageUsage &&
-            (pCreateInfo->imageUsage !=
-             (pCreateInfo->imageUsage & pCapabilities->supportedUsageFlags))) {
+        if (pCreateInfo->imageUsage !=
+            (pCreateInfo->imageUsage & pCapabilities->supportedUsageFlags)) {
             skipCall |= LOG_ERROR(VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, device, "VkDevice",
                                   SWAPCHAIN_CREATE_SWAP_BAD_IMG_USAGE_FLAGS,
                                   "%s() called with a non-supported "