Allocate internal allocations through preferred pool

Change-Id: Ib17431ceefc1eb72f86625e0998f679baaa7cb0d
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2018-12-21 10:16:27 +01:00
committed by sys_ocldev
parent 303014582a
commit f157943610
25 changed files with 119 additions and 68 deletions

View File

@@ -287,11 +287,11 @@ void CommandStreamReceiver::allocateHeapMemory(IndirectHeap::Type heapType,
auto heapMemory = internalAllocationStorage->obtainReusableAllocation(finalHeapSize, requireInternalHeap).release();
if (!heapMemory) {
auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM;
if (requireInternalHeap) {
heapMemory = getMemoryManager()->allocate32BitGraphicsMemory(finalHeapSize, nullptr, AllocationOrigin::INTERNAL_ALLOCATION);
} else {
heapMemory = getMemoryManager()->allocateGraphicsMemoryWithProperties({finalHeapSize, GraphicsAllocation::AllocationType::LINEAR_STREAM});
allocationType = GraphicsAllocation::AllocationType::INTERNAL_HEAP;
}
heapMemory = getMemoryManager()->allocateGraphicsMemoryWithProperties({finalHeapSize, allocationType});
} else {
finalHeapSize = std::max(heapMemory->getUnderlyingBufferSize(), finalHeapSize);
}