mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-22 14:36:35 +00:00
Store last swapchain presented and use it instead if none is specified
This commit is contained in:
@@ -702,6 +702,25 @@ bool WrappedVulkan::EndFrameCapture(void *dev, void *wnd)
|
||||
for(size_t i=0; i < swapInfo.images.size(); i++)
|
||||
GetResourceManager()->MarkResourceFrameReferenced(GetResID(swapInfo.images[i].im), eFrameRef_Read);
|
||||
}
|
||||
else
|
||||
{
|
||||
// if a swapchain wasn't specified or found, use the last one presented
|
||||
swaprecord = GetResourceManager()->GetResourceRecord(m_LastSwap);
|
||||
|
||||
if(swaprecord)
|
||||
{
|
||||
GetResourceManager()->MarkResourceFrameReferenced(swaprecord->GetResourceID(), eFrameRef_Read);
|
||||
RDCASSERT(swaprecord->swapInfo);
|
||||
|
||||
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
|
||||
{
|
||||
|
||||
@@ -389,6 +389,8 @@ private:
|
||||
|
||||
// capture-side data
|
||||
|
||||
ResourceId m_LastSwap;
|
||||
|
||||
// holds the current list of coherent mapped memory. Locked against concurrent use
|
||||
vector<VkResourceRecord*> m_CoherentMaps;
|
||||
Threading::CriticalSection m_CoherentMapsLock;
|
||||
|
||||
@@ -488,6 +488,7 @@ VkResult WrappedVulkan::vkQueuePresentKHR(
|
||||
// need to record which image was last flipped so we can get the correct backbuffer
|
||||
// for a thumbnail in EndFrameCapture
|
||||
swapInfo.lastPresent = pPresentInfo->imageIndices[0];
|
||||
m_LastSwap = swaprecord->GetResourceID();
|
||||
|
||||
VkImage backbuffer = swapInfo.images[pPresentInfo->imageIndices[0]].im;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user