From f7dd8f85fce42b3f4b0bdf29118c9b409aee97a0 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Tue, 28 Feb 2017 13:16:02 -0700 Subject: [PATCH] layers: Add VU 01185 and a test Added check for valid usage 01185. Added test CopyImageSampleCountMismatch() to verify the check. Change-Id: I51e76e0334bd4f1c0fe564f241646fc8b788da1e --- layers/buffer_validation.cpp | 8 ++++++++ layers/vk_validation_error_database.txt | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp index 32c6d63..0bafc23 100644 --- a/layers/buffer_validation.cpp +++ b/layers/buffer_validation.cpp @@ -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(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 diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt index d371b84..ca79938 100644 --- a/layers/vk_validation_error_database.txt +++ b/layers/vk_validation_error_database.txt @@ -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 -- 2.7.4