Correctly check max 1D image buffer size

VDI reports the limits in pixels, but user provides the size in bytes.

Make sure both values are in pixels before doing comparisons.

Change-Id: I082c7175c9fa4383e0b0ee38ff8c047c26ff20b4


[ROCm/hip commit: a81e7d63c6]
Este cometimento está contido em:
Vladislav Sytchenko criou e Vladislav Sytchenko cometeu 2020-04-09 21:37:43 -04:00
1 ascendente 0da6ea42ba
cometimento d40203e1c4
2 ficheiros modificados
+6 -1

Não existem ficheiros que correspondam à sua pesquisa

+1 -1
Ver ficheiro
@@ -100,7 +100,7 @@ hipError_t ihipCreateTextureObject(hipTextureObject_t* pTexObject,
if ((pResDesc->resType == hipResourceTypeLinear) &&
((pResDesc->res.linear.devPtr == nullptr) ||
(!amd::isMultipleOf(pResDesc->res.linear.devPtr, info.imageBaseAddressAlignment_)) ||
(pResDesc->res.linear.sizeInBytes >= info.imageMaxBufferSize_))) {
((pResDesc->res.linear.sizeInBytes / hip::getElementSize(pResDesc->res.linear.desc)) >= info.imageMaxBufferSize_))) {
return hipErrorInvalidValue;
}