Optimize makeResident call.

Some portions only make sense in Batching mode.

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2022-10-10 18:57:10 +00:00
committed by Compute-Runtime-Automation
parent fc0f600fd2
commit 2eb47bd73e

View File

@@ -138,10 +138,12 @@ void CommandStreamReceiver::makeResident(GraphicsAllocation &gfxAllocation) {
this->getResidencyAllocations().push_back(&gfxAllocation); this->getResidencyAllocations().push_back(&gfxAllocation);
} }
checkForNewResources(submissionTaskCount, gfxAllocation.getTaskCount(osContext->getContextId()), gfxAllocation);
gfxAllocation.updateTaskCount(submissionTaskCount, osContext->getContextId()); gfxAllocation.updateTaskCount(submissionTaskCount, osContext->getContextId());
if (!gfxAllocation.isResident(osContext->getContextId())) { if (this->dispatchMode == DispatchMode::BatchedDispatch) {
this->totalMemoryUsed += gfxAllocation.getUnderlyingBufferSize(); checkForNewResources(submissionTaskCount, gfxAllocation.getTaskCount(osContext->getContextId()), gfxAllocation);
if (!gfxAllocation.isResident(osContext->getContextId())) {
this->totalMemoryUsed += gfxAllocation.getUnderlyingBufferSize();
}
} }
} }
gfxAllocation.updateResidencyTaskCount(submissionTaskCount, osContext->getContextId()); gfxAllocation.updateResidencyTaskCount(submissionTaskCount, osContext->getContextId());