Start the lifetime of the texture reference

reinterpret_cast<> doesn't create an object, so the texref is actually unitiliazed. This may lead to garbage data in some of its struct members.

Initialize it by performing a placement new. The constructer should set all of its members to default values. There's no way currently to extract the channel type, so use single channel char for now.

Change-Id: I41b305a75bb3f30130324de785099f55b3e130c7
Tento commit je obsažen v:
Vladislav Sytchenko
2020-03-18 12:23:11 -04:00
rodič 117f0ab102
revize 292d008a64
2 změnil soubory, kde provedl 6 přidání a 1 odebrání
+4
Zobrazit soubor
@@ -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);
}