Reuse GraphicsAllocation mechanism for shared resources

Change-Id: I4bfd2d3387ae0fc10d461ebc1ada94614ab7f6b5
This commit is contained in:
Dunajski, Bartosz
2018-03-01 14:58:15 +01:00
committed by sys_ocldev
parent 7b30a7c2b8
commit e579578bc8
4 changed files with 52 additions and 1 deletions

View File

@@ -67,7 +67,10 @@ MemObj::~MemObj() {
}
if (memoryManager) {
if (graphicsAllocation && !associatedMemObject && !isObjectRedescribed && !isHostPtrSVM) {
if (peekSharingHandler()) {
peekSharingHandler()->releaseReusedGraphicsAllocation();
}
if (graphicsAllocation && !associatedMemObject && !isObjectRedescribed && !isHostPtrSVM && graphicsAllocation->reuseCount == 0) {
bool doAsyncDestrucions = DebugManager.flags.EnableAsyncDestroyAllocations.get();
if (!doAsyncDestrucions) {
needWait = true;