diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index 1c2f9d431..359a7d392 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -697,6 +697,10 @@ bool WrappedVulkan::EndFrameCapture(void *dev, void *wnd) const SwapchainInfo &swapInfo = *swaprecord->swapInfo; backbuffer = swapInfo.images[swapInfo.lastPresent].im; + + // mark all images referenced as well + for(size_t i=0; i < swapInfo.images.size(); i++) + GetResourceManager()->MarkResourceFrameReferenced(GetResID(swapInfo.images[i].im), eFrameRef_Read); } // transition back to IDLE atomically diff --git a/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp index ce8c8cee7..f04a7d683 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_wsi_funcs.cpp @@ -132,16 +132,17 @@ VkResult WrappedVulkan::vkGetSwapchainImagesKHR( } VkResourceRecord *record = GetResourceManager()->AddResourceRecord(pSwapchainImages[i]); - record->AddChunk(chunk); + VkResourceRecord *swaprecord = GetRecord(swapchain); record->SpecialResource = true; - // we invert the usual scheme - we make the swapchain record take parent refs - // on these images, so that we can just ref the swapchain on present and pull - // in all the images - VkResourceRecord *swaprecord = GetRecord(swapchain); + record->AddParent(swaprecord); - swaprecord->AddParent(record); + // note we add the chunk to the swap record, that way when the swapchain is created it will + // always create all of its images on replay. The image's record is kept around for reference + // tracking and any other chunks. Because it has a parent relationship on the swapchain, if + // the image is referenced the swapchain (and thus all the getimages) will be included. + swaprecord->AddChunk(chunk); } else {