aboutsummaryrefslogtreecommitdiff
path: root/layers/image.cpp
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2015-11-18 09:14:04 -0700
committerMark Lobodzinski <mark@lunarg.com>2015-11-18 09:15:06 -0700
commita66043a59144151ec7bf2354f9a36736f66623e4 (patch)
tree34e77e4c589b684fbb6e594f21d72f02c9ff309a /layers/image.cpp
parent70c9056e8d937fbd00c74673e1f3e39c806f0818 (diff)
downloadusermoji-a66043a59144151ec7bf2354f9a36736f66623e4.tar.xz
layers: Fix CreateImageView depth/stencil aspect validation
Diffstat (limited to 'layers/image.cpp')
-rw-r--r--layers/image.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/layers/image.cpp b/layers/image.cpp
index d97d77bc..64deef4e 100644
--- a/layers/image.cpp
+++ b/layers/image.cpp
@@ -431,10 +431,9 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device
// Compressed formats are compatible if the only difference between them is the numerical type of
// the uncompressed pixels (e.g. signed vs. unsigned, or sRGB vs. UNORM encoding).
} else if (vk_format_is_depth_and_stencil(imageFormat)) {
- if ((aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) !=
- (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
+ if ((aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) {
std::stringstream ss;
- ss << "vkCreateImageView: Combination depth/stencil image formats must have both VK_IMAGE_ASPECT_DEPTH_BIT and VK_IMAGE_ASPECT_STENCIL_BIT set";
+ ss << "vkCreateImageView: Depth/stencil image formats must have at least one of VK_IMAGE_ASPECT_DEPTH_BIT and VK_IMAGE_ASPECT_STENCIL_BIT set";
skipCall |= log_msg(device_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_IMAGE,
(uint64_t)pCreateInfo->image, 0, IMAGE_INVALID_IMAGE_ASPECT, "IMAGE", "%s", ss.str().c_str());
}