From 4723ceced8a434518d5346358f9314e60e0347b8 Mon Sep 17 00:00:00 2001 From: Vladislav Sytchenko Date: Tue, 17 Mar 2020 16:49:55 -0400 Subject: [PATCH] Correct the declaration of hipBindTextureToArray() The texture reference needs to be passed as a constant pointer. Change-Id: Iff171626536071fb2020cfff7132ec930577b1b9 [ROCm/hip commit: 2d773997479f7e4206077bc1999bad390b3972c6] --- projects/hip/include/hip/hcc_detail/hip_runtime_api.h | 7 +++++++ projects/hip/vdi/hip_texture.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/projects/hip/include/hip/hcc_detail/hip_runtime_api.h b/projects/hip/include/hip/hcc_detail/hip_runtime_api.h index 232ef44e7f..3a75fb680f 100644 --- a/projects/hip/include/hip/hcc_detail/hip_runtime_api.h +++ b/projects/hip/include/hip/hcc_detail/hip_runtime_api.h @@ -3443,8 +3443,15 @@ hipError_t hipBindTexture2D(size_t* offset, struct texture& te } // C API +#if __HIP_VDI__ +hipError_t hipBindTextureToArray( + const textureReference* tex, + hipArray_const_t array, + const hipChannelFormatDesc* desc); +#else hipError_t hipBindTextureToArray(textureReference* tex, hipArray_const_t array, const hipChannelFormatDesc* desc); +#endif hipError_t ihipBindTextureToArrayImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode, hipArray_const_t array, diff --git a/projects/hip/vdi/hip_texture.cpp b/projects/hip/vdi/hip_texture.cpp index 68c45308e5..0c9189a6ad 100644 --- a/projects/hip/vdi/hip_texture.cpp +++ b/projects/hip/vdi/hip_texture.cpp @@ -496,7 +496,7 @@ hipError_t ihipBindTextureToArray(const textureReference* texref, return ihipCreateTextureObject(const_cast(&texref->textureObject), &resDesc, &texDesc, &resViewDesc); } -hipError_t hipBindTextureToArray(textureReference* texref, +hipError_t hipBindTextureToArray(const textureReference* texref, hipArray_const_t array, const hipChannelFormatDesc* desc) { HIP_INIT_API(hipBindTextureToArray, texref, array, desc);