hipBindTexture() should handle nullptr offset.
If a user passes a ptr that was allocated by hipMalloc(), the offset is guaranteed to be 0 and NULL may be passed as the offset parameter. We shouldn't return an error in this case. Change-Id: I4a8d645121e5a17d5e2861a0629356a3599de9ee
This commit is contained in:
+2
-4
@@ -388,8 +388,7 @@ hipError_t ihipBindTexture(size_t* offset,
|
||||
const hipChannelFormatDesc* desc,
|
||||
size_t size,
|
||||
hipTextureReadMode readMode) {
|
||||
if ((offset == nullptr) ||
|
||||
(texref == nullptr) ||
|
||||
if ((texref == nullptr) ||
|
||||
(devPtr == nullptr) ||
|
||||
(desc == nullptr)) {
|
||||
return hipErrorInvalidValue;
|
||||
@@ -426,8 +425,7 @@ hipError_t ihipBindTexture2D(size_t* offset,
|
||||
size_t height,
|
||||
size_t pitch,
|
||||
hipTextureReadMode readMode) {
|
||||
if ((offset == nullptr) ||
|
||||
(texref == nullptr) ||
|
||||
if ((texref == nullptr) ||
|
||||
(devPtr == nullptr) ||
|
||||
(desc == nullptr)) {
|
||||
return hipErrorInvalidValue;
|
||||
|
||||
Reference in New Issue
Block a user