From 74b6afc51ed3f528c785529843099553821e854b Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Mon, 1 Aug 2016 15:51:39 -0600 Subject: layers: GH650, Fix D/S image layout validation When an imageView of a depth/stencil image is used as a depth/stencil framebuffer attachment, the aspectMask is ignored and both depth and stencil image subresources are used. Validation was throwing errors as only the specified aspectMask transition was tracked. Change-Id: I4f45eec74040448ba3ed52b07268fab3b3cb9318 --- layers/core_validation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 7ef5c9c8..7bc91f7d 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -3595,6 +3595,12 @@ void SetLayout(const layer_data *dev_data, GLOBAL_CB_NODE *pCB, VkImageView imag for (uint32_t k = 0; k < subRange.layerCount; k++) { uint32_t layer = subRange.baseArrayLayer + k; VkImageSubresource sub = {subRange.aspectMask, level, layer}; + // TODO: If ImageView was created with depth or stencil, transition both layouts as + // the aspectMask is ignored and both are used. Verify that the extra implicit layout + // is OK for descriptor set layout validation + if (subRange.aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { + sub.aspectMask |= (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT); + } SetLayout(pCB, image, sub, layout); } } -- cgit v1.2.3