Add support for deferred deletion of private surface.

- If it is in use add it to temporary allocation list
- If it is not in use destroy in place

Change-Id: I6304d1a3b641243f3f7eadff8e38d8515b132f68
This commit is contained in:
Mrozek, Michal
2018-01-18 16:41:35 +01:00
committed by sys_ocldev
parent 3e84c4df7a
commit c6233e1d06
2 changed files with 41 additions and 1 deletions

View File

@@ -114,7 +114,11 @@ Kernel::~Kernel() {
crossThreadDataSize = 0;
if (privateSurface) {
device.getMemoryManager()->freeGraphicsMemory(privateSurface);
if (privateSurface->taskCount == ObjectNotUsed || privateSurface->taskCount <= *device.getTagAddress()) {
device.getMemoryManager()->freeGraphicsMemory(privateSurface);
} else {
device.getMemoryManager()->storeAllocation(std::unique_ptr<GraphicsAllocation>(privateSurface), TEMPORARY_ALLOCATION);
}
privateSurface = nullptr;
}