PR Feedback MTLCommandBuffer::commit record tweak

MarkResourceFrameReferenced() on the buffer record instead of the resource manager
Transfer the frame references on the buffer record to the resource manager when the buffer is committed.
This commit is contained in:
Jake Turner authored and Baldur Karlsson committed 2022-04-13 11:33:03 +01:00
1 parent 149540139a
commit f8c792d84e
1 file changed
+5 -4
@@ -98,15 +98,16 @@ void WrappedMTLCommandBuffer::commit()
Serialise_commit(ser);
chunk = scope.Get();
}
MetalResourceRecord *record = GetRecord(this);
record->AddChunk(chunk);
MetalResourceRecord *bufferRecord = GetRecord(this);
bufferRecord->AddChunk(chunk);
bool capframe = IsActiveCapturing(m_State);
if(capframe)
{
record->AddRef();
GetResourceManager()->MarkResourceFrameReferenced(GetResID(m_WrappedMTLCommandQueue),
eFrameRef_Read);
bufferRecord->MarkResourceFrameReferenced(GetResID(m_WrappedMTLCommandQueue), eFrameRef_Read);
// pull in frame refs from this command buffer
bufferRecord->AddResourceReferences(GetResourceManager());
}
}
else