aboutsummaryrefslogtreecommitdiff
path: root/layers/buffer_validation.cpp
diff options
context:
space:
mode:
authorDave Houlton <daveh@lunarg.com>2018-03-26 17:08:30 -0600
committerDave Houlton <daveh@lunarg.com>2018-03-27 13:46:57 -0600
commita32e5c917714ff604a8cd78dce414140b1409247 (patch)
tree51a1a467bc86ee5856b02009ce574971d817e50d /layers/buffer_validation.cpp
parent72ba811f7677b54115323b4c95c14785322da1e0 (diff)
downloadusermoji-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
Diffstat (limited to 'layers/buffer_validation.cpp')
-rw-r--r--layers/buffer_validation.cpp47
1 files changed, 30 insertions, 17 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) {