MCPcopy Create free account
hub / github.com/baldurk/renderdoc / EndFrameCapture

Method EndFrameCapture

renderdoc/driver/vulkan/vk_core.cpp:2808–3336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2806}
2807
2808bool WrappedVulkan::EndFrameCapture(DeviceOwnedWindow devWnd)
2809{
2810 if(!IsActiveCapturing(m_State))
2811 return true;
2812
2813 if(m_CaptureFailure)
2814 {
2815 m_LastCaptureFailed = Timing::GetUnixTimestamp();
2816 return DiscardFrameCapture(devWnd);
2817 }
2818
2819 m_CaptureFailure = false;
2820
2821 VkSwapchainKHR swap = VK_NULL_HANDLE;
2822
2823 if(devWnd.windowHandle)
2824 {
2825 {
2826 SCOPED_LOCK(m_SwapLookupLock);
2827 auto it = m_SwapLookup.find(devWnd.windowHandle);
2828 if(it != m_SwapLookup.end())
2829 swap = it->second;
2830 }
2831
2832 if(swap == VK_NULL_HANDLE)
2833 {
2834 RDCERR("Output window %p provided for frame capture corresponds with no known swap chain",
2835 devWnd.windowHandle);
2836 return false;
2837 }
2838 }
2839
2840 RDCLOG("Finished capture, Frame %u", m_CapturedFrames.back().frameNumber);
2841
2842 VkImage backbuffer = VK_NULL_HANDLE;
2843 const ImageInfo *swapImageInfo = NULL;
2844 uint32_t swapQueueIndex = 0;
2845 VkImageLayout swapLayout = VK_IMAGE_LAYOUT_UNDEFINED;
2846
2847 if(swap != VK_NULL_HANDLE)
2848 {
2849 GetResourceManager()->MarkResourceFrameReferenced(GetResID(swap), eFrameRef_Read);
2850
2851 VkResourceRecord *swaprecord = GetRecord(swap);
2852 RDCASSERT(swaprecord->swapInfo);
2853
2854 const SwapchainInfo &swapInfo = *swaprecord->swapInfo;
2855
2856 backbuffer = swapInfo.images[swapInfo.lastPresent.imageIndex].userSwapImage;
2857 swapImageInfo = &swapInfo.imageInfo;
2858 swapQueueIndex = GetRecord(swapInfo.lastPresent.presentQueue)->queueFamilyIndex;
2859 swapLayout =
2860 swapInfo.shared ? VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR : VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
2861
2862 // mark all images referenced as well
2863 for(size_t i = 0; i < swapInfo.images.size(); i++)
2864 GetResourceManager()->MarkResourceFrameReferenced(GetResID(swapInfo.images[i].userSwapImage),
2865 eFrameRef_Read);

Callers 4

PresentMethod · 0.45
HandleFrameMarkersMethod · 0.45
vkQueueSubmitMethod · 0.45
vkQueueSubmit2Method · 0.45

Calls 15

IsActiveCapturingFunction · 0.85
DiscardFrameCaptureFunction · 0.85
ObjDispFunction · 0.85
FreeAlignedBufferFunction · 0.85
DoPipelineBarrierFunction · 0.85
ToStrFunction · 0.85
CreateBufferMethod · 0.80
BindBufferMemoryMethod · 0.80
CreateRDCMethod · 0.80

Tested by

no test coverage detected