aboutsummaryrefslogtreecommitdiff
path: root/layers/buffer_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2017-02-16 13:21:20 -0700
committerTobin Ehlis <tobine@google.com>2017-02-16 16:25:56 -0700
commit0c00eec12748bd04ef662a6cf92c50fe8f4d5e3e (patch)
tree1ed7d393cdcf6e1f2fe380d85d038a16b68c7381 /layers/buffer_validation.cpp
parent8d1ed9e10adab988445bcf528fd995ef3bde6953 (diff)
downloadusermoji-0c00eec12748bd04ef662a6cf92c50fe8f4d5e3e.tar.xz
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.
Diffstat (limited to 'layers/buffer_validation.cpp')
-rw-r--r--layers/buffer_validation.cpp7
1 files changed, 7 insertions, 0 deletions
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;
}