From 7137c7f3d87247bbb3c21b9d575e1c8a2eff2505 Mon Sep 17 00:00:00 2001 From: Todd tiantuo Li <88386084+lttamd@users.noreply.github.com> Date: Fri, 19 Sep 2025 20:48:01 -0700 Subject: [PATCH] SWDEV-541478 - return hipSuccess for hipTexObjectCreate TypePitch2D with zero width or height (#712) --- projects/clr/hipamd/src/hip_texture.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/clr/hipamd/src/hip_texture.cpp b/projects/clr/hipamd/src/hip_texture.cpp index e96d542397..7d2e12287b 100644 --- a/projects/clr/hipamd/src/hip_texture.cpp +++ b/projects/clr/hipamd/src/hip_texture.cpp @@ -1491,6 +1491,11 @@ hipError_t hipTexObjectCreate(hipTextureObject_t* pTexObject, const HIP_RESOURCE HIP_RETURN(hipErrorInvalidValue); } + if (static_cast(pResDesc->resType) == hipResourceTypePitch2D && + ((pResDesc->res.pitch2D.width == 0) || (pResDesc->res.pitch2D.height == 0))) { + HIP_RETURN(hipSuccess); + } + hipResourceDesc resDesc = hip::getResourceDesc(*pResDesc); hipTextureDesc texDesc = hip::getTextureDesc(*pTexDesc);