layers: Remove redundant validation from image layer
authorMark Lobodzinski <mark@lunarg.com>
Thu, 2 Feb 2017 23:12:37 +0000 (16:12 -0700)
committerMark Lobodzinski <mark@lunarg.com>
Fri, 3 Feb 2017 22:55:20 +0000 (15:55 -0700)
CmdPipelineBarrier validation in image layer is already performed in
core_validation via checks 769 and 2598. Updated MiscImageLayerTests
to use existing VU id as well as database with new test name.

Change-Id: I218dacf6a98ad576aa7cb07c1b33784a105faee6

layers/image.cpp
layers/vk_validation_error_database.txt

index bd9cbbc..655c341 100644 (file)
@@ -510,37 +510,6 @@ VKAPI_ATTR void VKAPI_CALL CmdBlitImage(VkCommandBuffer commandBuffer, VkImage s
     }
 }
 
-VKAPI_ATTR void VKAPI_CALL CmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask,
-                                              VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
-                                              uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers,
-                                              uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers,
-                                              uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) {
-    bool skipCall = false;
-    layer_data *device_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map);
-
-    for (uint32_t i = 0; i < imageMemoryBarrierCount; ++i) {
-        VkImageMemoryBarrier const *const barrier = (VkImageMemoryBarrier const *const) & pImageMemoryBarriers[i];
-        // TODO: add VALIDATION_ERROR_00309 (sType == VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER) here
-        if (barrier->sType == VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER) {
-            // TODO: this check should include VALIDATION_ERROR_00301 and VALIDATION_ERROR_00316
-            if (barrier->subresourceRange.layerCount == 0) {
-                std::stringstream ss;
-                ss << "vkCmdPipelineBarrier called with 0 in ppMemoryBarriers[" << i << "]->subresourceRange.layerCount.";
-                skipCall |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0,
-                                    __LINE__, IMAGE_INVALID_IMAGE_RESOURCE, "IMAGE", "%s", ss.str().c_str());
-            }
-        }
-    }
-
-    if (skipCall) {
-        return;
-    }
-
-    device_data->device_dispatch_table->CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags,
-                                                           memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount,
-                                                           pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers);
-}
-
 VKAPI_ATTR void VKAPI_CALL CmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout,
                                            VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount,
                                            const VkImageResolve *pRegions) {
@@ -767,7 +736,6 @@ static PFN_vkVoidFunction intercept_core_device_command(const char *name) {
         {"vkCmdCopyImageToBuffer", reinterpret_cast<PFN_vkVoidFunction>(CmdCopyImageToBuffer)},
         {"vkCmdCopyBufferToImage", reinterpret_cast<PFN_vkVoidFunction>(CmdCopyBufferToImage)},
         {"vkCmdBlitImage", reinterpret_cast<PFN_vkVoidFunction>(CmdBlitImage)},
-        {"vkCmdPipelineBarrier", reinterpret_cast<PFN_vkVoidFunction>(CmdPipelineBarrier)},
         {"vkCmdResolveImage", reinterpret_cast<PFN_vkVoidFunction>(CmdResolveImage)},
         {"vkGetImageSubresourceLayout", reinterpret_cast<PFN_vkVoidFunction>(GetImageSubresourceLayout)},
     };
index f5b0c66..45fcc7b 100644 (file)
@@ -757,7 +757,7 @@ VALIDATION_ERROR_00765~^~N~^~Unknown~^~vkCreateImageView~^~For more information
 VALIDATION_ERROR_00766~^~N~^~Unknown~^~vkCreateImageView~^~For more information refer to Vulkan Spec Section '11.5. Image Views' which states 'components must be a valid VkComponentMapping structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageViewCreateInfo)~^~implicit
 VALIDATION_ERROR_00767~^~N~^~Unknown~^~vkCreateImageView~^~For more information refer to Vulkan Spec Section '11.5. Image Views' which states 'subresourceRange must be a valid VkImageSubresourceRange structure' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageViewCreateInfo)~^~implicit
 VALIDATION_ERROR_00768~^~Y~^~InvalidImageView,ImageLayerViewTests,InvalidBarriers~^~vkCreateImageView~^~For more information refer to Vulkan Spec Section '11.5. Image Views' which states 'If levelCount is not VK_REMAINING_MIP_LEVELS, levelCount must be non-zero and (baseMipLevel + levelCount) must be less than or equal to the mipLevels specified in VkImageCreateInfo when the image was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageAspectFlagBits)~^~Dual purposing this for when levelCount is 0, need new valid usage language for that case
-VALIDATION_ERROR_00769~^~Y~^~ImageLayerViewTests,InvalidBarriers~^~vkCreateImageView~^~For more information refer to Vulkan Spec Section '11.5. Image Views' which states 'If the imageType specified in VkImageCreateInfo when the image was created was VK_IMAGE_TYPE_3D and the image view is created with the viewType of VkImageViewCreateInfo set to VK_VIEW_TYPE_2D_ARRAY then layerCount must be VK_REMAINING_ARRAY_LAYERS, or layerCount must be non-zero and (baseArrayLayer + layerCount) must be less than or equal to the extent.depth specified in VkImageCreateInfo when the image was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageAspectFlagBits)~^~Dual purposing this for when layerCount is 0, need new valid usage language for that case
+VALIDATION_ERROR_00769~^~Y~^~MiscImageLayerTests,ImageLayerViewTests,InvalidBarriers~^~vkCreateImageView~^~For more information refer to Vulkan Spec Section '11.5. Image Views' which states 'If the imageType specified in VkImageCreateInfo when the image was created was VK_IMAGE_TYPE_3D and the image view is created with the viewType of VkImageViewCreateInfo set to VK_VIEW_TYPE_2D_ARRAY then layerCount must be VK_REMAINING_ARRAY_LAYERS, or layerCount must be non-zero and (baseArrayLayer + layerCount) must be less than or equal to the extent.depth specified in VkImageCreateInfo when the image was created' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageAspectFlagBits)~^~Dual purposing this for when layerCount is 0, need new valid usage language for that case
 VALIDATION_ERROR_00770~^~N~^~Unknown~^~vkCreateImageView~^~For more information refer to Vulkan Spec Section '11.5. Image Views' which states 'aspectMask must be a valid combination of VkImageAspectFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageAspectFlagBits)~^~implicit
 VALIDATION_ERROR_00771~^~N~^~Unknown~^~vkCreateImageView~^~For more information refer to Vulkan Spec Section '11.5. Image Views' which states 'aspectMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageAspectFlagBits)~^~implicit
 VALIDATION_ERROR_00772~^~N~^~Unknown~^~vkCreateImageView~^~For more information refer to Vulkan Spec Section '11.5. Image Views' which states 'r must be a valid VkComponentSwizzle value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkComponentSwizzle)~^~implicit