diff --git a/hipamd/vdi/hip_module.cpp b/hipamd/vdi/hip_module.cpp index 66955fcf3d..b92155e518 100644 --- a/hipamd/vdi/hip_module.cpp +++ b/hipamd/vdi/hip_module.cpp @@ -528,6 +528,10 @@ hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const HIP_RETURN(hipErrorNotFound); } + // Texture references created by HIP driver API + // have the default read mode set to normalized float. + (*texRef)->readMode = hipReadModeNormalizedFloat; + HIP_RETURN(hipSuccess); } diff --git a/hipamd/vdi/hip_platform.cpp b/hipamd/vdi/hip_platform.cpp index 57a37b02a5..4b0db00b1a 100644 --- a/hipamd/vdi/hip_platform.cpp +++ b/hipamd/vdi/hip_platform.cpp @@ -361,7 +361,8 @@ bool PlatformState::getTexRef(const char* hostVar, hipModule_t hmod, textureRefe return false; } - *texRef = reinterpret_cast(dvar->shadowVptr); + *texRef = new (dvar->shadowVptr) texture{}; + return true; }