From 507ee4373127d0ff2d8ef03e7790ca6108b8ce50 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Fri, 14 Oct 2016 12:13:33 -0600 Subject: layers: Add Val IDs for a more cmdCopyImage checks A couple more of the CmdCopyImage checks that have LVTs got added. One of the remaining ones is not covered by valid usage but is a 'must' check, will add later. Change-Id: Id9a1b7ad276c159149be4ef8c29d845baae29a35 --- layers/image.cpp | 10 ++++++---- layers/vk_validation_error_database.txt | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/layers/image.cpp b/layers/image.cpp index 059a7d5a..b15733d1 100644 --- a/layers/image.cpp +++ b/layers/image.cpp @@ -791,9 +791,10 @@ bool cmd_copy_image_valid_usage(VkCommandBuffer commandBuffer, VkImage srcImage, std::stringstream ss; ss << "vkCmdCopyImage: number of layers in source and destination subresources for pRegions[" << i << "] do not match"; - skipCall |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, reinterpret_cast(commandBuffer), - __LINE__, IMAGE_INVALID_EXTENTS, "IMAGE", "%s", ss.str().c_str()); + skipCall |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + reinterpret_cast(commandBuffer), __LINE__, VALIDATION_ERROR_01198, "IMAGE", "%s. %s", + ss.str().c_str(), validation_error_map[VALIDATION_ERROR_01198]); } // For each region, the aspectMask member of srcSubresource and dstSubresource must match @@ -929,7 +930,8 @@ bool cmd_copy_image_valid_usage(VkCommandBuffer commandBuffer, VkImage srcImage, char const str[] = "vkCmdCopyImage called with unmatched source and dest image format sizes."; skipCall |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - reinterpret_cast(commandBuffer), __LINE__, IMAGE_MISMATCHED_IMAGE_FORMAT, "IMAGE", str); + reinterpret_cast(commandBuffer), __LINE__, VALIDATION_ERROR_01184, "IMAGE", "%s. %s", str, + validation_error_map[VALIDATION_ERROR_01176]); } } } diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt index d4a5e0a4..891d8305 100644 --- a/layers/vk_validation_error_database.txt +++ b/layers/vk_validation_error_database.txt @@ -1190,7 +1190,7 @@ VALIDATION_ERROR_01180~^~U~^~Unknown~^~For more information refer to Vulkan Spec VALIDATION_ERROR_01181~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'dstImage must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#copies-images-format-compatibility) VALIDATION_ERROR_01182~^~U~^~Unknown~^~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/xhtml/vkspec.html#copies-images-format-compatibility) VALIDATION_ERROR_01183~^~U~^~Unknown~^~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/xhtml/vkspec.html#copies-images-format-compatibility) -VALIDATION_ERROR_01184~^~U~^~Unknown~^~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/xhtml/vkspec.html#copies-images-format-compatibility) +VALIDATION_ERROR_01184~^~Y~^~CopyImageFormatSizeMismatch~^~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/xhtml/vkspec.html#copies-images-format-compatibility) VALIDATION_ERROR_01185~^~U~^~Unknown~^~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/xhtml/vkspec.html#copies-images-format-compatibility) VALIDATION_ERROR_01186~^~Y~^~Unknown~^~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/xhtml/vkspec.html#copies-images-format-compatibility) VALIDATION_ERROR_01187~^~Y~^~Unknown~^~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/xhtml/vkspec.html#copies-images-format-compatibility) @@ -1204,7 +1204,7 @@ VALIDATION_ERROR_01194~^~U~^~Unknown~^~For more information refer to Vulkan Spec VALIDATION_ERROR_01195~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'regionCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#copies-images-format-compatibility) VALIDATION_ERROR_01196~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' 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/xhtml/vkspec.html#copies-images-format-compatibility) VALIDATION_ERROR_01197~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'The aspectMask member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkImageCopy) -VALIDATION_ERROR_01198~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'The layerCount member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkImageCopy) +VALIDATION_ERROR_01198~^~Y~^~CopyImageLayerCountMismatch~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'The layerCount member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkImageCopy) VALIDATION_ERROR_01199~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' 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/xhtml/vkspec.html#VkImageCopy) VALIDATION_ERROR_01200~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' 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/xhtml/vkspec.html#VkImageCopy) VALIDATION_ERROR_01201~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '18.3. Copying Data Between Images' which states 'The aspectMask member of dstSubresource must specify aspects present in the calling commands dstImage' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkImageCopy) -- cgit v1.2.3