From dcfd0c25c7fff1c8ae231b234870027e913c08bf Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Tue, 17 Jan 2017 11:13:23 +0000 Subject: layers: PR1381, Fix vkCmdCopyImage intersection check RegionIntersects would return true if the source and destination array layers and mip level did *not* overlap, resulting in a spurious validation error when trying to copy between different array layers or mip levels of the same image. Change-Id: I2e5675f703a4f5e2e7cbfd1d038bd38c7d7dafe0 --- layers/image.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'layers/image.cpp') diff --git a/layers/image.cpp b/layers/image.cpp index 45786f8f..fd4e1338 100644 --- a/layers/image.cpp +++ b/layers/image.cpp @@ -526,11 +526,11 @@ static bool RangesIntersect(int32_t start, uint32_t start_offset, int32_t end, u // Returns true if two VkImageCopy structures overlap static bool RegionIntersects(const VkImageCopy *src, const VkImageCopy *dst, VkImageType type) { - bool result = true; + bool result = false; if ((src->srcSubresource.mipLevel == dst->dstSubresource.mipLevel) && (RangesIntersect(src->srcSubresource.baseArrayLayer, src->srcSubresource.layerCount, dst->dstSubresource.baseArrayLayer, dst->dstSubresource.layerCount))) { - + result = true; switch (type) { case VK_IMAGE_TYPE_3D: result &= RangesIntersect(src->srcOffset.z, src->extent.depth, dst->dstOffset.z, dst->extent.depth); -- cgit v1.2.3