WSI Validation: Removed 2 checks that are driver-specific.
authorIan Elliott <ian@lunarg.com>
Mon, 28 Sep 2015 17:24:53 +0000 (11:24 -0600)
committerIan Elliott <ian@lunarg.com>
Mon, 28 Sep 2015 17:24:53 +0000 (11:24 -0600)
The purpose of this layer is to validate the application's usage of WSI, not to
validate the driver's conformance with WSI.

layers/swapchain.cpp
layers/swapchain.h
layers/vk_validation_layer_details.md

index 97fbd1457bb16f9d05bb0494b710b377d96ab7c8..bfcd2ab87d83766d44c44325c854d05f7f2806f6 100644 (file)
@@ -896,6 +896,9 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetSwapchainImagesKHR(VkDevice device, VkSwapch
         result = device_dispatch_table(device)->GetSwapchainImagesKHR(
                 device, swapchain, pCount, pSwapchainImages);
 
+// TBD: Should we validate that this function was called once with
+// pSwapchainImages set to NULL (and record pCount at that time), and then
+// called again with a non-NULL pSwapchainImages?
         if ((result == VK_SUCCESS) && pSwapchain &&pSwapchainImages &&
             pCount && (*pCount > 0)) {
             // Record the images and their state:
@@ -977,22 +980,6 @@ VK_LAYER_EXPORT VkResult VKAPI vkAcquireNextImageKHR(VkDevice device, VkSwapchai
 
         if (((result == VK_SUCCESS) || (result == VK_SUBOPTIMAL_KHR)) &&
             pSwapchain) {
-            if (*pImageIndex >= pSwapchain->imageCount) {
-                LOG_ERROR(VK_OBJECT_TYPE_SWAPCHAIN_KHR, swapchain,
-                          "VkSwapchainKHR",
-                          SWAPCHAIN_INDEX_TOO_LARGE,
-                          "%s() returned an index that's too large (i.e. %d).  "
-                          "There are only %d images in this VkSwapchainKHR.",
-                          __FUNCTION__, *pImageIndex, pSwapchain->imageCount);
-            }
-            if (pSwapchain->images[*pImageIndex].ownedByApp) {
-                LOG_ERROR(VK_OBJECT_TYPE_SWAPCHAIN_KHR, swapchain,
-                          "VkSwapchainKHR",
-                          SWAPCHAIN_INDEX_ALREADY_IN_USE,
-                          "%s() returned an index (i.e. %d) for an image that "
-                          "is already owned by the application.\n",
-                          __FUNCTION__, *pImageIndex);
-            }
             // Change the state of the image (now owned by the application):
             pSwapchain->images[*pImageIndex].ownedByApp = true;
         }
index 286a23bf308ecacd2e32906979ded03a0700733c..8414d474b91215940d931c2d8de1ac94e55d2679 100644 (file)
@@ -60,7 +60,6 @@ typedef enum _SWAPCHAIN_ERROR
     SWAPCHAIN_DESTROY_SWAP_DIFF_DEVICE,         // Called vkDestroySwapchainKHR() with a different VkDevice than vkCreateSwapchainKHR()
     SWAPCHAIN_APP_OWNS_TOO_MANY_IMAGES,         // vkAcquireNextImageKHR() asked for more images than are available
     SWAPCHAIN_INDEX_TOO_LARGE,                  // Index is too large for swapchain
-    SWAPCHAIN_INDEX_ALREADY_IN_USE,             // vkAcquireNextImageKHR() returned index that is already owned by app
     SWAPCHAIN_INDEX_NOT_IN_USE,                 // vkQueuePresentKHR() given index that is not owned by app
 } SWAPCHAIN_ERROR;
 
index 0639ffb1836f82aa0cd1cc485683a49ad7afb2e4..998d3cf72d0021b535ebbd1de4529d196a3bc244 100644 (file)
@@ -319,8 +319,7 @@ For the second category of errors, DeviceLimits stores its own internal record o
 | vkCreateSwapchainKHR(pCreateInfo->presentMode) | Validates vkCreateSwapchainKHR(pCreateInfo->presentMode) | CREATE_SWAP_BAD_PRESENT_MODE | vkCreateSwapchainKHR | NA | None |
 | Use same device for swapchain | Validates that vkDestroySwapchainKHR() called with the same VkDevice as vkCreateSwapchainKHR() | DESTROY_SWAP_DIFF_DEVICE | vkDestroySwapchainKHR | NA | None |
 | Don't use too many images | Validates that app never tries to own too many swapchain images at a time | APP_OWNS_TOO_MANY_IMAGES | vkAcquireNextImageKHR | NA | None |
-| Index too large | Validates that an image index is within the number of images in a swapchain | INDEX_TOO_LARGE | vkAcquireNextImageKHR vkQueuePresentKHR | NA | None |
-| Can't use an simultaneously use an image | If vkAcquireNextImageKHR() returns index of an image that is already owned by the application | INDEX_ALREADY_IN_USE | vkAcquireNextImageKHR | NA | None |
+| Index too large | Validates that an image index is within the number of images in a swapchain | INDEX_TOO_LARGE | vkQueuePresentKHR | NA | None |
 | Can't present a non-owned image | Validates that application only presents images that it owns | INDEX_NOT_IN_USE | vkQueuePresentKHR | NA | None |
 
 ### Swapchain Pending Work