diff options
| author | Marcin Kantoch <Marcin.Kantoch@amd.com> | 2017-01-27 12:33:21 +0100 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2017-01-27 08:55:56 -0700 |
| commit | 8d5226c619572dacf4778aa95dc51a98557f9554 (patch) | |
| tree | ad963c73d77dd7e9b1693592a63e4a92091cd087 /layers/image.cpp | |
| parent | 85dbd823c410a2817b077e2c6d1ee0cda7e247dd (diff) | |
| download | usermoji-8d5226c619572dacf4778aa95dc51a98557f9554.tar.xz | |
layers: Fix for VkBufferImageCopy for depth/stencil
According to the Vulkan spec:
"If the the calling command's VkImage parameter's format is not a
depth/stencil format, then VkBufferImageCopy::bufferOffset must be
a multiple of the format's element size"
Currently the image validation layer is checking unconditionally if
VkBufferImageCopy::bufferOffset is a multiple of the format's
element size and reporting error otherwise.
Added code that skips the alignment check if the VkImage parameter's
format is combined depth/stencil.
Change-Id: I92f2a67eee590fa3616df9da121aceec65204c24
Diffstat (limited to 'layers/image.cpp')
| -rw-r--r-- | layers/image.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/layers/image.cpp b/layers/image.cpp index c82c0ac8..ddc07382 100644 --- a/layers/image.cpp +++ b/layers/image.cpp @@ -843,9 +843,10 @@ static bool ValidateBufferImageCopyData(layer_data *dev_data, uint32_t regionCou } } - // BufferOffset must be a multiple of the calling command's VkImage parameter's texel size + // If the the calling command's VkImage parameter's format is not a depth/stencil format, + // then bufferOffset must be a multiple of the calling command's VkImage parameter's texel size auto texel_size = vk_format_get_size(image_info->format); - if (vk_safe_modulo(pRegions[i].bufferOffset, texel_size) != 0) { + if (!vk_format_is_depth_and_stencil(image_info->format) && vk_safe_modulo(pRegions[i].bufferOffset, texel_size) != 0) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, reinterpret_cast<uint64_t &>(image), __LINE__, VALIDATION_ERROR_01263, "IMAGE", "%s(): pRegion[%d] bufferOffset 0x%" PRIxLEAST64 |
