diff options
| author | Dave Houlton <daveh@lunarg.com> | 2018-03-26 17:08:30 -0600 |
|---|---|---|
| committer | Dave Houlton <daveh@lunarg.com> | 2018-03-27 13:46:57 -0600 |
| commit | a32e5c917714ff604a8cd78dce414140b1409247 (patch) | |
| tree | 51a1a467bc86ee5856b02009ce574971d817e50d | |
| parent | 72ba811f7677b54115323b4c95c14785322da1e0 (diff) | |
| download | usermoji-a32e5c917714ff604a8cd78dce414140b1409247.tar.xz | |
layers: fix copyimage checks broken by spec change
Changes to 'core' spec between 1.0.68 and .71 split some CmdCopyImage
VUIDs into two. This updates the existing checks/tests and adds test
coverage for the new VUIDs.
Change-Id: I9efd0de2c830dca5b7214168d5339bf2fd9fdf08
| -rw-r--r-- | layers/buffer_validation.cpp | 47 | ||||
| -rw-r--r-- | layers/vk_validation_error_database.txt | 4 |
2 files changed, 32 insertions, 19 deletions
diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp index ebf99a87..3a369803 100644 --- a/layers/buffer_validation.cpp +++ b/layers/buffer_validation.cpp @@ -1541,17 +1541,23 @@ bool ValidateImageCopyData(const layer_data *device_data, const debug_report_dat } } - if ((src_state->createInfo.imageType == VK_IMAGE_TYPE_1D) || (src_state->createInfo.imageType == VK_IMAGE_TYPE_2D)) { - if ((0 != region.srcOffset.z) || (1 != src_copy_extent.depth)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(src_state->image), __LINE__, VALIDATION_ERROR_09c00df2, "IMAGE", - "vkCmdCopyImage(): pRegion[%d] srcOffset.z is %d and extent.depth is %d. For 1D and 2D images " - "these must be 0 and 1, respectively. %s", - i, region.srcOffset.z, src_copy_extent.depth, validation_error_map[VALIDATION_ERROR_09c00df2]); - } + // VUID-VkImageCopy-srcImage-01785 + if ((src_state->createInfo.imageType == VK_IMAGE_TYPE_1D) && ((0 != region.srcOffset.z) || (1 != src_copy_extent.depth))) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(src_state->image), __LINE__, VALIDATION_ERROR_09c00df2, "IMAGE", + "vkCmdCopyImage(): pRegion[%d] srcOffset.z is %d and extent.depth is %d. For 1D images " + "these must be 0 and 1, respectively. %s", + i, region.srcOffset.z, src_copy_extent.depth, validation_error_map[VALIDATION_ERROR_09c00df2]); + } + + // VUID-VkImageCopy-srcImage-01787 + if ((src_state->createInfo.imageType == VK_IMAGE_TYPE_2D) && (0 != region.srcOffset.z)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(src_state->image), __LINE__, VALIDATION_ERROR_09c00df6, "IMAGE", + "vkCmdCopyImage(): pRegion[%d] srcOffset.z is %d. For 2D images the z-offset must be 0. %s", i, + region.srcOffset.z, validation_error_map[VALIDATION_ERROR_09c00df6]); } - // VU01199 changed with mnt1 if (GetDeviceExtensions(device_data)->vk_khr_maintenance1) { if (src_state->createInfo.imageType == VK_IMAGE_TYPE_3D) { if ((0 != region.srcSubresource.baseArrayLayer) || (1 != region.srcSubresource.layerCount)) { @@ -1643,14 +1649,21 @@ bool ValidateImageCopyData(const layer_data *device_data, const debug_report_dat } } - if ((dst_state->createInfo.imageType == VK_IMAGE_TYPE_1D) || (dst_state->createInfo.imageType == VK_IMAGE_TYPE_2D)) { - if ((0 != region.dstOffset.z) || (1 != dst_copy_extent.depth)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - HandleToUint64(dst_state->image), __LINE__, VALIDATION_ERROR_09c00df4, "IMAGE", - "vkCmdCopyImage(): pRegion[%d] dstOffset.z is %d and dst_copy_extent.depth is %d. For 1D and 2D " - "images these must be 0 and 1, respectively. %s", - i, region.dstOffset.z, dst_copy_extent.depth, validation_error_map[VALIDATION_ERROR_09c00df4]); - } + // VUID-VkImageCopy-dstImage-01786 + if ((dst_state->createInfo.imageType == VK_IMAGE_TYPE_1D) && ((0 != region.dstOffset.z) || (1 != dst_copy_extent.depth))) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(dst_state->image), __LINE__, VALIDATION_ERROR_09c00df4, "IMAGE", + "vkCmdCopyImage(): pRegion[%d] dstOffset.z is %d and extent.depth is %d. For 1D images these must be 0 " + "and 1, respectively. %s", + i, region.dstOffset.z, dst_copy_extent.depth, validation_error_map[VALIDATION_ERROR_09c00df4]); + } + + // VUID-VkImageCopy-dstImage-01788 + if ((dst_state->createInfo.imageType == VK_IMAGE_TYPE_2D) && (0 != region.dstOffset.z)) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + HandleToUint64(dst_state->image), __LINE__, VALIDATION_ERROR_09c00df8, "IMAGE", + "vkCmdCopyImage(): pRegion[%d] dstOffset.z is %d. For 2D images the z-offset must be 0. %s", i, + region.dstOffset.z, validation_error_map[VALIDATION_ERROR_09c00df8]); } if (dst_state->createInfo.imageType == VK_IMAGE_TYPE_3D) { diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt index 6a77251b..aca9c560 100644 --- a/layers/vk_validation_error_database.txt +++ b/layers/vk_validation_error_database.txt @@ -657,8 +657,8 @@ VALIDATION_ERROR_09c00d8a~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-dstImage-0 VALIDATION_ERROR_09c00d8c~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-dstImage-01734~^~(VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion)~^~The spec valid usage text states 'If the calling command's dstImage is a compressed format image, or a single-plane, "_422" image format, extent.depth must be a multiple of the compressed texel block depth or (extent.depth + dstOffset.z) must equal the destination image subresource depth' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-dstImage-01734)~^~ VALIDATION_ERROR_09c00df2~^~Y~^~CopyImageTypeExtentMismatch~^~VkImageCopy~^~VUID-VkImageCopy-srcImage-01785~^~core~^~The spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_1D, then srcOffset.z must be 0 and extent.depth must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcImage-01785)~^~ VALIDATION_ERROR_09c00df4~^~Y~^~CopyImageTypeExtentMismatch~^~VkImageCopy~^~VUID-VkImageCopy-dstImage-01786~^~core~^~The spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_1D, then dstOffset.z must be 0 and extent.depth must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstImage-01786)~^~ -VALIDATION_ERROR_09c00df6~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-srcImage-01787~^~core~^~The spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_2D, then srcOffset.z must be 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcImage-01787)~^~ -VALIDATION_ERROR_09c00df8~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-dstImage-01788~^~core~^~The spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_2D, then dstOffset.z must be 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstImage-01788)~^~ +VALIDATION_ERROR_09c00df6~^~Y~^~CopyImageTypeExtentMismatch~^~VkImageCopy~^~VUID-VkImageCopy-srcImage-01787~^~core~^~The spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_2D, then srcOffset.z must be 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcImage-01787)~^~ +VALIDATION_ERROR_09c00df8~^~Y~^~CopyImageTypeExtentMismatch~^~VkImageCopy~^~VUID-VkImageCopy-dstImage-01788~^~core~^~The spec valid usage text states 'If the calling command's dstImage is of type VK_IMAGE_TYPE_2D, then dstOffset.z must be 0.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-dstImage-01788)~^~ VALIDATION_ERROR_09c00dfa~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-srcImage-01789~^~!(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'If the calling command's srcImage or dstImage is of type VK_IMAGE_TYPE_2D, then extent.depth must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCopy-srcImage-01789)~^~ VALIDATION_ERROR_09c00dfc~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-srcImage-01790~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'If both srcImage and dstImage are of type VK_IMAGE_TYPE_2D then then extent.depth must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01790)~^~ VALIDATION_ERROR_09c00dfe~^~N~^~None~^~VkImageCopy~^~VUID-VkImageCopy-srcImage-01791~^~(VK_VERSION_1_1,VK_KHR_maintenance1)~^~The spec valid usage text states 'If the calling command's srcImage is of type VK_IMAGE_TYPE_2D, and the dstImage is of type VK_IMAGE_TYPE_3D, then extent.depth must equal to the layerCount member of srcSubresource.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageCopy-srcImage-01791)~^~ |
