Reuse graphics allocations in readBufferRect/writeBufferRect

Related-To: NEO-6352
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2021-11-02 15:17:05 +00:00
committed by Compute-Runtime-Automation
parent 9c1e7422b1
commit a582f34c04
8 changed files with 152 additions and 30 deletions

View File

@@ -77,11 +77,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteBuffer(
if (mapAllocation) {
surfaces[1] = &mapSurface;
mapSurface.setGraphicsAllocation(mapAllocation);
//get offset between base cpu ptr of map allocation and dst ptr
if ((memoryType != DEVICE_UNIFIED_MEMORY) && (memoryType != SHARED_UNIFIED_MEMORY)) {
size_t srcOffset = ptrDiff(srcPtr, mapAllocation->getUnderlyingBuffer());
srcPtr = reinterpret_cast<void *>(mapAllocation->getGpuAddress() + srcOffset);
}
srcPtr = convertAddressWithOffsetToGpuVa(srcPtr, memoryType, *mapAllocation);
} else {
surfaces[1] = &hostPtrSurf;
if (size != 0) {