Fixes for misaligned hostPtr enqueueReadWrite

- use getGpuAddress for BuiltinOpParams
- fix read/writeImage

Change-Id: I2e6e9a1d91871fa9f22851f31eb5a7b337b5aecc
This commit is contained in:
Hoppe, Mateusz
2019-01-10 15:38:56 +01:00
committed by sys_ocldev
parent 3c59bae5a4
commit 64ff9d30b7
11 changed files with 275 additions and 25 deletions

View File

@@ -88,13 +88,6 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBuffer(
BuiltInOwnershipWrapper builtInLock(builder, this->context);
void *dstPtr = ptr;
void *alignedDstPtr = dstPtr;
size_t dstPtrOffset = 0;
if (!isAligned<4>(dstPtr)) {
alignedDstPtr = alignDown(dstPtr, 4);
dstPtrOffset = ptrDiff(dstPtr, alignedDstPtr);
}
MemObjSurface bufferSurf(buffer);
HostPtrSurface hostPtrSurf(dstPtr, size);
@@ -105,8 +98,12 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadBuffer(
if (!status) {
return CL_OUT_OF_RESOURCES;
}
dstPtr = reinterpret_cast<void *>(hostPtrSurf.getAllocation()->getGpuAddress());
}
void *alignedDstPtr = alignDown(dstPtr, 4);
size_t dstPtrOffset = ptrDiff(dstPtr, alignedDstPtr);
BuiltinDispatchInfoBuilder::BuiltinOpParams dc;
dc.dstPtr = alignedDstPtr;
dc.dstOffset = {dstPtrOffset, 0, 0};