layers: Correct BlitImage check and add VU ID
authorMark Lobodzinski <mark@lunarg.com>
Tue, 7 Feb 2017 20:44:57 +0000 (13:44 -0700)
committerMark Lobodzinski <mark@lunarg.com>
Tue, 7 Feb 2017 21:02:48 +0000 (14:02 -0700)
This check was only getting performed for depth/stencil images.
Enabled for all image types and added correct valid usage ID.

Change-Id: Ie2a8dcded8a55da73527fb435987eaa538c8d5e1

layers/buffer_validation.cpp
layers/vk_validation_error_database.txt

index 2b31134..2de17de 100644 (file)
@@ -1387,6 +1387,13 @@ bool PreCallValidateCmdBlitImage(core_validation::layer_data *device_data, GLOBA
                             "vkCmdBlitImage: layerCount in source and destination subresource of pRegions[%d] does not match. %s",
                             i, validation_error_map[VALIDATION_ERROR_01304]);
             }
+
+            if (pRegions[i].srcSubresource.aspectMask != pRegions[i].dstSubresource.aspectMask) {
+                skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+                                reinterpret_cast<uint64_t>(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_01303, "IMAGE",
+                                "vkCmdBlitImage: aspectMask members for pRegion[%d] do not match. %s", i,
+                                validation_error_map[VALIDATION_ERROR_01303]);
+            }
         }
 
         VkFormat src_format = src_image_state->createInfo.format;
@@ -1430,16 +1437,7 @@ bool PreCallValidateCmdBlitImage(core_validation::layer_data *device_data, GLOBA
 
             for (uint32_t i = 0; i < regionCount; i++) {
                 VkImageAspectFlags srcAspect = pRegions[i].srcSubresource.aspectMask;
-                VkImageAspectFlags dstAspect = pRegions[i].dstSubresource.aspectMask;
 
-                if (srcAspect != dstAspect) {
-                    std::stringstream ss;
-                    ss << "vkCmdBlitImage: Image aspects of depth/stencil images should match";
-                    // TODO: Verify against Valid Use section of spec, if this case yields undefined results, then it's an error
-                    skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
-                                    reinterpret_cast<uint64_t>(cb_node->commandBuffer), __LINE__, DRAWSTATE_INVALID_IMAGE_ASPECT,
-                                    "IMAGE", "%s", ss.str().c_str());
-                }
                 if (vk_format_is_depth_and_stencil(src_format)) {
                     if ((srcAspect != VK_IMAGE_ASPECT_DEPTH_BIT) && (srcAspect != VK_IMAGE_ASPECT_STENCIL_BIT)) {
                         std::stringstream ss;
index 6216dc7..26a5598 100644 (file)
@@ -1288,7 +1288,7 @@ VALIDATION_ERROR_01299~^~N~^~Unknown~^~vkCmdBlitImage~^~For more information ref
 VALIDATION_ERROR_01300~^~Y~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdBlitImage)~^~implicit
 VALIDATION_ERROR_01301~^~N~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'regionCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdBlitImage)~^~implicit
 VALIDATION_ERROR_01302~^~N~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'Each of commandBuffer, dstImage, and srcImage must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdBlitImage)~^~implicit
-VALIDATION_ERROR_01303~^~N~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'The aspectMask member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageBlit)~^~
+VALIDATION_ERROR_01303~^~Y~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'The aspectMask member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageBlit)~^~
 VALIDATION_ERROR_01304~^~Y~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'The layerCount member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageBlit)~^~
 VALIDATION_ERROR_01305~^~N~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'If either of the calling commands srcImage or dstImage parameters are of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of both srcSubresource and dstSubresource must be 0 and 1, respectively' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageBlit)~^~
 VALIDATION_ERROR_01306~^~N~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'The aspectMask member of srcSubresource must specify aspects present in the calling commands srcImage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageBlit)~^~