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
2022-04-12 04:59:22 +01:00
committed by Baldur Karlsson
parent 149540139a
commit f8c792d84e
@@ -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