mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-13 05:20:45 +00:00
Fix device-type resources not being referenced on D3D12/VK
This commit is contained in:
@@ -1511,8 +1511,6 @@ void WrappedID3D12Device::StartFrameCapture(void *dev, void *wnd)
|
||||
|
||||
GetResourceManager()->ClearReferencedResources();
|
||||
|
||||
GetResourceManager()->MarkResourceFrameReferenced(m_ResourceID, eFrameRef_Read);
|
||||
|
||||
// need to do all this atomically so that no other commands
|
||||
// will check to see if they need to markdirty or markpendingdirty
|
||||
// and go into the frame record.
|
||||
@@ -1557,6 +1555,8 @@ void WrappedID3D12Device::StartFrameCapture(void *dev, void *wnd)
|
||||
m_State = CaptureState::ActiveCapturing;
|
||||
}
|
||||
|
||||
GetResourceManager()->MarkResourceFrameReferenced(m_ResourceID, eFrameRef_Read);
|
||||
|
||||
RDCLOG("Starting capture, frame %u", m_FrameCounter);
|
||||
}
|
||||
|
||||
|
||||
@@ -1435,21 +1435,6 @@ void WrappedVulkan::StartFrameCapture(void *dev, void *wnd)
|
||||
GetResourceManager()->ClearReferencedResources();
|
||||
GetResourceManager()->ClearReferencedMemory();
|
||||
|
||||
GetResourceManager()->MarkResourceFrameReferenced(GetResID(m_Instance), eFrameRef_Read);
|
||||
GetResourceManager()->MarkResourceFrameReferenced(GetResID(m_Device), eFrameRef_Read);
|
||||
GetResourceManager()->MarkResourceFrameReferenced(GetResID(m_Queue), eFrameRef_Read);
|
||||
|
||||
std::map<ResourceId, FrameRefType> forced = GetForcedReferences();
|
||||
|
||||
// Note we force read-before-write because this resource is implicitly untracked so we have no
|
||||
// way of knowing how it's used
|
||||
for(auto it = forced.begin(); it != forced.end(); ++it)
|
||||
{
|
||||
GetResourceManager()->MarkResourceFrameReferenced(it->first, eFrameRef_Read);
|
||||
if(it->second != eFrameRef_Read)
|
||||
GetResourceManager()->MarkResourceFrameReferenced(it->first, it->second);
|
||||
}
|
||||
|
||||
// need to do all this atomically so that no other commands
|
||||
// will check to see if they need to markdirty or markpendingdirty
|
||||
// and go into the frame record.
|
||||
@@ -1507,6 +1492,21 @@ void WrappedVulkan::StartFrameCapture(void *dev, void *wnd)
|
||||
m_State = CaptureState::ActiveCapturing;
|
||||
}
|
||||
|
||||
GetResourceManager()->MarkResourceFrameReferenced(GetResID(m_Instance), eFrameRef_Read);
|
||||
GetResourceManager()->MarkResourceFrameReferenced(GetResID(m_Device), eFrameRef_Read);
|
||||
GetResourceManager()->MarkResourceFrameReferenced(GetResID(m_Queue), eFrameRef_Read);
|
||||
|
||||
std::map<ResourceId, FrameRefType> forced = GetForcedReferences();
|
||||
|
||||
// Note we force read-before-write because this resource is implicitly untracked so we have no
|
||||
// way of knowing how it's used
|
||||
for(auto it = forced.begin(); it != forced.end(); ++it)
|
||||
{
|
||||
GetResourceManager()->MarkResourceFrameReferenced(it->first, eFrameRef_Read);
|
||||
if(it->second != eFrameRef_Read)
|
||||
GetResourceManager()->MarkResourceFrameReferenced(it->first, it->second);
|
||||
}
|
||||
|
||||
RDCLOG("Starting capture, frame %u", m_FrameCounter);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user