mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Simplify memory manager API [1/n]
pass struct with properties to allocate graphics memory methods: for protected methods use AllocationData for public methods use AllocationProperties Change-Id: Ie1c3cb6b5e330bc4adac2ca8b0bf02d30ec76065 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
ace20aba5b
commit
c8748b77a0
@@ -355,7 +355,10 @@ bool CommandStreamReceiver::createAllocationForHostSurface(HostPtrSurface &surfa
|
||||
allocation = memoryManager->allocateGraphicsMemoryForHostPtr(surface.getSurfaceSize(), surface.getMemoryPointer(), device.isFullRangeSvm(), requiresL3Flush);
|
||||
if (allocation == nullptr && surface.peekIsPtrCopyAllowed()) {
|
||||
// Try with no host pointer allocation and copy
|
||||
allocation = memoryManager->allocateGraphicsMemory(surface.getSurfaceSize(), MemoryConstants::pageSize, false, false);
|
||||
AllocationProperties properties;
|
||||
properties.alignment = MemoryConstants::pageSize;
|
||||
properties.size = surface.getSurfaceSize();
|
||||
allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties);
|
||||
|
||||
if (allocation) {
|
||||
memcpy_s(allocation->getUnderlyingBuffer(), allocation->getUnderlyingBufferSize(), surface.getMemoryPointer(), surface.getSurfaceSize());
|
||||
|
||||
Reference in New Issue
Block a user