Set correct offset for images created from buffer

- images from subbuffer with non-zero offset relative to
parent buffer didn't have correct Surface Address offset

Change-Id: I6ae2b87f8c9d19e40ec14a29b5eadc7401db18ad
This commit is contained in:
Hoppe, Mateusz
2018-05-24 17:15:35 +02:00
committed by sys_ocldev
parent 63edbcfd63
commit 4c4e682bc7
3 changed files with 110 additions and 0 deletions

View File

@@ -206,6 +206,12 @@ Image *Image::create(Context *context,
hostPtrToSet = const_cast<void *>(hostPtr);
parentBuffer->incRefInternal();
Gmm::queryImgFromBufferParams(imgInfo, memory);
auto bufferOffset = static_cast<uint32_t>(parentBuffer->getOffset());
if (bufferOffset != 0) {
imgInfo.offset = bufferOffset;
}
if (memoryManager->peekVirtualPaddingSupport() && (imageDesc->image_type == CL_MEM_OBJECT_IMAGE2D)) {
// Retrieve sizes from GMM and apply virtual padding if buffer storage is not big enough
auto queryGmmImgInfo(imgInfo);