mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
Fixes for misaligned hostPtr enqueueReadWrite
- use getGpuAddress for BuiltinOpParams - fix read/writeImage Change-Id: I2e6e9a1d91871fa9f22851f31eb5a7b337b5aecc
This commit is contained in:
committed by
sys_ocldev
parent
3c59bae5a4
commit
64ff9d30b7
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user