mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-31 12:11:31 +08:00
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:
committed by
sys_ocldev
parent
63edbcfd63
commit
4c4e682bc7
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user