layers: Add VU 01185 and a test
authorDave Houlton <daveh@lunarg.com>
Tue, 28 Feb 2017 20:16:02 +0000 (13:16 -0700)
committerDave Houlton <daveh@lunarg.com>
Thu, 16 Mar 2017 22:58:26 +0000 (16:58 -0600)
Added check for valid usage 01185.  Added test
CopyImageSampleCountMismatch() to verify the check.

Change-Id: I51e76e0334bd4f1c0fe564f241646fc8b788da1e

layers/buffer_validation.cpp
layers/vk_validation_error_database.txt

index 32c6d63..0bafc23 100644 (file)
@@ -1443,6 +1443,14 @@ bool PreCallValidateCmdCopyImage(layer_data *device_data, GLOBAL_CB_NODE *cb_nod
         }
     }
 
+    // Source and dest image sample counts must match
+    if (src_image_state->createInfo.samples != dst_image_state->createInfo.samples) {
+        char const str[] = "vkCmdCopyImage() called on image pair with non-identical sample counts.";
+        skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+            reinterpret_cast<uint64_t &>(command_buffer), __LINE__, VALIDATION_ERROR_01185, "IMAGE", "%s %s", str,
+            validation_error_map[VALIDATION_ERROR_01185]);
+    }
+
     skip |= ValidateMemoryIsBoundToImage(device_data, src_image_state, "vkCmdCopyImage()", VALIDATION_ERROR_02533);
     skip |= ValidateMemoryIsBoundToImage(device_data, dst_image_state, "vkCmdCopyImage()", VALIDATION_ERROR_02534);
     // Validate that SRC & DST images have correct usage flags set
index d371b84..ca79938 100644 (file)
@@ -1173,7 +1173,7 @@ VALIDATION_ERROR_01181~^~Y~^~None~^~vkCmdCopyImage~^~For more information refer
 VALIDATION_ERROR_01182~^~N~^~Unknown~^~vkCmdCopyImage~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'dstImageLayout must specify the layout of the image subresources of dstImage specified in pRegions at the time this command is executed on a VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdCopyImage)~^~
 VALIDATION_ERROR_01183~^~Y~^~Unknown~^~vkCmdCopyImage~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'dstImageLayout must be either of VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdCopyImage)~^~
 VALIDATION_ERROR_01184~^~Y~^~CopyImageFormatSizeMismatch~^~vkCmdCopyImage~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'The VkFormat of each of srcImage and dstImage must be compatible, as defined below' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdCopyImage)~^~
-VALIDATION_ERROR_01185~^~N~^~Unknown~^~vkCmdCopyImage~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'The sample count of srcImage and dstImage must match' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdCopyImage)~^~
+VALIDATION_ERROR_01185~^~Y~^~CopyImageMiscAttributesMismatch~^~vkCmdCopyImage~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'The sample count of srcImage and dstImage must match' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdCopyImage)~^~
 VALIDATION_ERROR_01186~^~Y~^~None~^~vkCmdCopyImage~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdCopyImage)~^~implicit
 VALIDATION_ERROR_01187~^~Y~^~None~^~vkCmdCopyImage~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'srcImage must be a valid VkImage handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdCopyImage)~^~implicit
 VALIDATION_ERROR_01188~^~N~^~Unknown~^~vkCmdCopyImage~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'srcImageLayout must be a valid VkImageLayout value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdCopyImage)~^~implicit