From 0c00eec12748bd04ef662a6cf92c50fe8f4d5e3e Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Thu, 16 Feb 2017 13:21:20 -0700 Subject: layers:RenderPass depth/stencil layout transition Fixes #1454 For image views into depth/stencil images we need to make sure that both the depth and stencil aspects have their layouts transitioned to the initialLayout setting for the first subpass. --- layers/buffer_validation.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'layers/buffer_validation.cpp') diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp index ef1d04b0..118df5e2 100644 --- a/layers/buffer_validation.cpp +++ b/layers/buffer_validation.cpp @@ -274,6 +274,7 @@ bool VerifyFramebufferAndRenderPassLayouts(layer_data *device_data, GLOBAL_CB_NO IMAGE_CMD_BUF_LAYOUT_NODE newNode = {pRenderPassInfo->pAttachments[i].initialLayout, pRenderPassInfo->pAttachments[i].initialLayout}; // TODO: Do not iterate over every possibility - consolidate where possible + // TODO: Consolidate this with SetImageViewLayout() function above for (uint32_t j = 0; j < subRange.levelCount; j++) { uint32_t level = subRange.baseMipLevel + j; for (uint32_t k = 0; k < subRange.layerCount; k++) { @@ -281,6 +282,12 @@ bool VerifyFramebufferAndRenderPassLayouts(layer_data *device_data, GLOBAL_CB_NO VkImageSubresource sub = {subRange.aspectMask, level, layer}; IMAGE_CMD_BUF_LAYOUT_NODE node; if (!FindCmdBufLayout(device_data, pCB, image, sub, node)) { + // If ImageView was created with depth or stencil, transition both aspects if it's a DS image + if (subRange.aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { + if (vk_format_is_depth_and_stencil(view_state->create_info.format)) { + sub.aspectMask |= (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT); + } + } SetLayout(device_data, pCB, image, sub, newNode); continue; } -- cgit v1.2.3