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++) {
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;
}