From: Mark Lobodzinski Date: Fri, 9 Dec 2016 18:20:23 +0000 (-0700) Subject: layers: GH1244, Fix Compressed BufferImageCopy errs X-Git-Tag: sdk-1.0.37.0~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b10e59bb49bc6bd9f35bb03363b0e9880fe8179c;p=platform%2Fupstream%2FVulkan-LoaderAndValidationLayers.git layers: GH1244, Fix Compressed BufferImageCopy errs CmdCopyBufferToImage and CmdCopyImageToBuffer were validating compressed image attributes against the valid usage conditions for uncompressed images. Added check for compressed images and skipped this validation, and TODO for future compressed VU addition. Change-Id: I09a7dc98cb0f925c7486ef9f2d6de31411c7ea1c --- diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index d979368..647e209 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -8472,14 +8472,29 @@ static inline bool ValidateCopyBufferImageTransferGranularityRequirements(layer_ const IMAGE_STATE *img, const VkBufferImageCopy *region, const uint32_t i, const char *function) { bool skip = false; - VkExtent3D granularity = GetScaledItg(dev_data, cb_node, img); - skip |= CheckItgSize(dev_data, cb_node, region->bufferOffset, granularity.width, i, function, "bufferOffset"); - skip |= CheckItgInt(dev_data, cb_node, region->bufferRowLength, granularity.width, i, function, "bufferRowLength"); - skip |= CheckItgInt(dev_data, cb_node, region->bufferImageHeight, granularity.width, i, function, "bufferImageHeight"); - skip |= CheckItgOffset(dev_data, cb_node, ®ion->imageOffset, &granularity, i, function, "imageOffset"); - VkExtent3D subresource_extent = GetImageSubresourceExtent(img, ®ion->imageSubresource); - skip |= CheckItgExtent(dev_data, cb_node, ®ion->imageExtent, ®ion->imageOffset, &granularity, &subresource_extent, i, - function, "imageExtent"); + if (vk_format_is_compressed(img->createInfo.format) == true) { + // TODO: Add granularity checking for compressed formats + + // bufferRowLength must be a multiple of the compressed texel block width + // bufferImageHeight must be a multiple of the compressed texel block height + // all members of imageOffset must be a multiple of the corresponding dimensions of the compressed texel block + // bufferOffset must be a multiple of the compressed texel block size in bytes + // imageExtent.width must be a multiple of the compressed texel block width or (imageExtent.width + imageOffset.x) + // must equal the image subresource width + // imageExtent.height must be a multiple of the compressed texel block height or (imageExtent.height + imageOffset.y) + // must equal the image subresource height + // imageExtent.depth must be a multiple of the compressed texel block depth or (imageExtent.depth + imageOffset.z) + // must equal the image subresource depth + } else { + VkExtent3D granularity = GetScaledItg(dev_data, cb_node, img); + skip |= CheckItgSize(dev_data, cb_node, region->bufferOffset, granularity.width, i, function, "bufferOffset"); + skip |= CheckItgInt(dev_data, cb_node, region->bufferRowLength, granularity.width, i, function, "bufferRowLength"); + skip |= CheckItgInt(dev_data, cb_node, region->bufferImageHeight, granularity.width, i, function, "bufferImageHeight"); + skip |= CheckItgOffset(dev_data, cb_node, ®ion->imageOffset, &granularity, i, function, "imageOffset"); + VkExtent3D subresource_extent = GetImageSubresourceExtent(img, ®ion->imageSubresource); + skip |= CheckItgExtent(dev_data, cb_node, ®ion->imageExtent, ®ion->imageOffset, &granularity, &subresource_extent, i, + function, "imageExtent"); + } return skip; }