From cc2d49ad1c011012ae614dea1981c97c3aadad04 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 10 Jan 2022 14:05:51 +0000 Subject: [PATCH] Fix handling of unused attachments in dynamic rendering. Closes #2432 --- renderdoc/driver/vulkan/vk_next_chains.cpp | 2 +- renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/vulkan/vk_next_chains.cpp b/renderdoc/driver/vulkan/vk_next_chains.cpp index e7ac48fd9..64e4e9dab 100644 --- a/renderdoc/driver/vulkan/vk_next_chains.cpp +++ b/renderdoc/driver/vulkan/vk_next_chains.cpp @@ -1103,7 +1103,7 @@ size_t GetNextPatchSize(const void *pNext) if(info->pDepthAttachment) { memSize += sizeof(*info->pDepthAttachment); - memSize += GetNextPatchSize(info->pStencilAttachment->pNext); + memSize += GetNextPatchSize(info->pDepthAttachment->pNext); } if(info->pStencilAttachment) { diff --git a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp index 1ae20f78e..35898b601 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp @@ -6920,7 +6920,7 @@ void WrappedVulkan::vkCmdBeginRenderingKHR(VkCommandBuffer commandBuffer, else if(i == pRenderingInfo->colorAttachmentCount + 1) att = pRenderingInfo->pStencilAttachment; - if(!att) + if(!att || !att->imageView) continue; FrameRefType refType = eFrameRef_ReadBeforeWrite;