| 1311 | } |
| 1312 | |
| 1313 | hipError_t hipTexRefGetMipMappedArray(hipMipmappedArray_t* pArray, const textureReference* texRef) { |
| 1314 | // TODO overload operator<<(ostream&, textureReference&). |
| 1315 | HIP_INIT_API(hipTexRefGetMipMappedArray, pArray, &texRef); |
| 1316 | |
| 1317 | if ((pArray == nullptr) || (texRef == nullptr)) { |
| 1318 | HIP_RETURN(hipErrorInvalidValue); |
| 1319 | } |
| 1320 | amd::Device* device = hip::getCurrentDevice()->devices()[0]; |
| 1321 | const device::Info& info = device->info(); |
| 1322 | if (!info.imageSupport_) { |
| 1323 | LogPrintfError("Texture not supported on the device %s", info.name_); |
| 1324 | HIP_RETURN(hipErrorNotSupported); |
| 1325 | } |
| 1326 | |
| 1327 | hipResourceDesc resDesc = {}; |
| 1328 | // TODO use ihipGetTextureObjectResourceDesc() to not pollute the API trace. |
| 1329 | hipError_t error = ihipGetTextureObjectResourceDesc(&resDesc, texRef->textureObject); |
| 1330 | if (error != hipSuccess) { |
| 1331 | HIP_RETURN(error); |
| 1332 | } |
| 1333 | |
| 1334 | switch (resDesc.resType) { |
| 1335 | case hipResourceTypeLinear: |
| 1336 | case hipResourceTypePitch2D: |
| 1337 | case hipResourceTypeArray: { |
| 1338 | HIP_RETURN(hipErrorInvalidValue); |
| 1339 | } |
| 1340 | case hipResourceTypeMipmappedArray: |
| 1341 | *pArray = resDesc.res.mipmap.mipmap; |
| 1342 | break; |
| 1343 | } |
| 1344 | |
| 1345 | HIP_RETURN(hipSuccess); |
| 1346 | } |
| 1347 | |
| 1348 | hipError_t hipTexRefSetBorderColor(textureReference* texRef, float* pBorderColor) { |
| 1349 | HIP_INIT_API(hipTexRefSetBorderColor, texRef, pBorderColor); |
nothing calls this directly
no test coverage detected