Fix device-type resources not being referenced on D3D12/VK

This commit is contained in:
baldurk
2019-07-25 10:28:28 +01:00
parent 3cc9557264
commit c5409b40cf
2 changed files with 17 additions and 17 deletions
+2 -2
View File
@@ -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);
}
+15 -15
View File
@@ -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);
}