aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2016-12-09 11:20:23 -0700
committerMark Lobodzinski <mark@lunarg.com>2016-12-09 13:08:11 -0700
commit0b347ed6dd07f0ffda7fb778530c476d00d5116b (patch)
tree80df04ce583983c1b0de638be2757bffb7b1d835 /layers/core_validation.cpp
parentf492e960e57f119ca9e4e6a56ca0a90da3221ceb (diff)
downloadusermoji-0b347ed6dd07f0ffda7fb778530c476d00d5116b.tar.xz
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
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index d9793683..647e2090 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, &region->imageOffset, &granularity, i, function, "imageOffset");
- VkExtent3D subresource_extent = GetImageSubresourceExtent(img, &region->imageSubresource);
- skip |= CheckItgExtent(dev_data, cb_node, &region->imageExtent, &region->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, &region->imageOffset, &granularity, i, function, "imageOffset");
+ VkExtent3D subresource_extent = GetImageSubresourceExtent(img, &region->imageSubresource);
+ skip |= CheckItgExtent(dev_data, cb_node, &region->imageExtent, &region->imageOffset, &granularity, &subresource_extent, i,
+ function, "imageExtent");
+ }
return skip;
}