Don't align 2D image buffer size

Cuda allows creating 2D textures from memory with unaligned size.
Aligning it will cause us to overshoot the size of the underlying
allocation.

Change-Id: Ia20dec2105e36ca4a8448c9c6299d0001b388d25


[ROCm/hip commit: 844dab3b22]
Este commit está contenido en:
Vlad Sytchenko
2020-07-27 13:22:19 -04:00
cometido por Vladislav Sytchenko
padre f665059911
commit 003e50f6cb
+3 -1
Ver fichero
@@ -269,8 +269,10 @@ hipError_t ihipCreateTextureObject(hipTextureObject_t* pTexObject,
case hipResourceTypePitch2D: {
const cl_channel_order channelOrder = hip::getCLChannelOrder(hip::getNumChannels(pResDesc->res.pitch2D.desc), pTexDesc->sRGB);
const cl_channel_type channelType = hip::getCLChannelType(hip::getArrayFormat(pResDesc->res.pitch2D.desc), pTexDesc->readMode);
const amd::Image::Format imageFormat({channelOrder, channelType});
const cl_mem_object_type imageType = hip::getCLMemObjectType(pResDesc->resType);
const size_t imageSizeInBytes = pResDesc->res.pitch2D.pitchInBytes * pResDesc->res.pitch2D.height;
const size_t imageSizeInBytes = pResDesc->res.pitch2D.width * imageFormat.getElementSize() +
pResDesc->res.pitch2D.pitchInBytes * (pResDesc->res.pitch2D.height - 1);
amd::Memory* buffer = getMemoryObjectWithOffset(pResDesc->res.pitch2D.devPtr, imageSizeInBytes);
image = ihipImageCreate(channelOrder,
channelType,