mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-26 15:46:08 +00:00
Stop forcing references for resourced invalidated by freed bound memory
This commit is contained in:
@@ -349,7 +349,7 @@ struct ResourceRecord
|
|||||||
Parents.push_back(r);
|
Parents.push_back(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bool HasParent(ResourceRecord *r) const { return Parents.indexOf(r) >= 0; }
|
||||||
void MarkParentsDirty(ResourceRecordHandler *mgr)
|
void MarkParentsDirty(ResourceRecordHandler *mgr)
|
||||||
{
|
{
|
||||||
for(auto it = Parents.begin(); it != Parents.end(); ++it)
|
for(auto it = Parents.begin(); it != Parents.end(); ++it)
|
||||||
|
|||||||
@@ -747,6 +747,18 @@ void WrappedVulkan::vkFreeMemory(VkDevice device, VkDeviceMemory memory,
|
|||||||
|
|
||||||
if(IsCaptureMode(m_State))
|
if(IsCaptureMode(m_State))
|
||||||
{
|
{
|
||||||
|
VkResourceRecord *memrecord = GetRecord(memory);
|
||||||
|
|
||||||
|
// any forced references were already processed at the start of the frame if we're mid capture.
|
||||||
|
// If we're background capturing though, we need to make sure not to force in buffers
|
||||||
|
// referencing this now-dead memory, as a new memory allocation could be created and use the
|
||||||
|
// same BDA address
|
||||||
|
{
|
||||||
|
SCOPED_LOCK(m_ForcedReferencesLock);
|
||||||
|
m_ForcedReferences.removeIf(
|
||||||
|
[memrecord](const VkResourceRecord *record) { return record->HasParent(memrecord); });
|
||||||
|
}
|
||||||
|
|
||||||
// artificially extend the lifespan of buffer device address memory or buffers, to ensure their
|
// artificially extend the lifespan of buffer device address memory or buffers, to ensure their
|
||||||
// opaque capture address isn't re-used before the capture completes
|
// opaque capture address isn't re-used before the capture completes
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user