layers: LX273, Fix accessMask validation for depth/stencil input attachments
authorMark Lobodzinski <mark@lunarg.com>
Tue, 12 Jan 2016 20:18:44 +0000 (13:18 -0700)
committerMark Lobodzinski <mark@lunarg.com>
Tue, 12 Jan 2016 21:06:21 +0000 (14:06 -0700)
When using an imageView of a depth/stencil image to populate a descriptor set,
the aspectMask must only include one bit and selects whether the imageView is
used for depth reads or stencil reads.

layers/image.cpp

index 6da2f40..1281dfb 100644 (file)
@@ -937,10 +937,10 @@ VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBlitImage(
                                        (uint64_t)commandBuffer, __LINE__, IMAGE_INVALID_IMAGE_ASPECT, "IMAGE", "%s", ss.str().c_str());
                 }
                 if (vk_format_is_depth_and_stencil(srcFormat)) {
-                    if (srcAspect != (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
+                    if ((srcAspect != VK_IMAGE_ASPECT_DEPTH_BIT) && (srcAspect != VK_IMAGE_ASPECT_STENCIL_BIT)) {
                         std::stringstream ss;
-                        ss << "vkCmdBlitImage: Combination depth/stencil image formats must have both VK_IMAGE_ASPECT_DEPTH_BIT "
-                           << "and VK_IMAGE_ASPECT_STENCIL_BIT set in both the srcImage and dstImage";
+                        ss << "vkCmdBlitImage: Combination depth/stencil image formats must have only one of VK_IMAGE_ASPECT_DEPTH_BIT "
+                           << "and VK_IMAGE_ASPECT_STENCIL_BIT set in srcImage and dstImage";
                         skipCall |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
                                            (uint64_t)commandBuffer, __LINE__, IMAGE_INVALID_IMAGE_ASPECT, "IMAGE", "%s", ss.str().c_str());
                     }