diff options
author | Sayak Biswas <sayakAMD> | 2021-11-20 03:26:30 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-11-20 16:02:38 +0300 |
commit | f2bb42a095acde57c540ff619c422132f491ef1c (patch) | |
tree | 7961ada32dd74a28db861a691d2685b421378e7b | |
parent | b20997cb341ee993c770ed5ebddd0981f89b25c1 (diff) |
Fix T92984: Cycles HIP crash with smoke volumes
This fixes the the app crash happening when trying to render smoke as a dense
3D texture. The changes are related to matching up hipew with the actual HIP
headers.
Differential Revision: https://developer.blender.org/D13296
-rw-r--r-- | extern/hipew/include/hipew.h | 38 | ||||
-rw-r--r-- | intern/cycles/device/hip/device_impl.cpp | 10 |
2 files changed, 23 insertions, 25 deletions
diff --git a/extern/hipew/include/hipew.h b/extern/hipew/include/hipew.h index d18cf67524d..90a538719ab 100644 --- a/extern/hipew/include/hipew.h +++ b/extern/hipew/include/hipew.h @@ -804,31 +804,29 @@ typedef enum hipDeviceP2PAttr { } hipDeviceP2PAttr; typedef struct HIP_MEMCPY3D { - size_t srcXInBytes; - size_t srcY; - size_t srcZ; - size_t srcLOD; + unsigned int srcXInBytes; + unsigned int srcY; + unsigned int srcZ; + unsigned int srcLOD; hipMemoryType srcMemoryType; const void* srcHost; hipDeviceptr_t srcDevice; - hArray * srcArray; - void* reserved0; - size_t srcPitch; - size_t srcHeight; - size_t dstXInBytes; - size_t dstY; - size_t dstZ; - size_t dstLOD; + hArray srcArray; + unsigned int srcPitch; + unsigned int srcHeight; + unsigned int dstXInBytes; + unsigned int dstY; + unsigned int dstZ; + unsigned int dstLOD; hipMemoryType dstMemoryType; void* dstHost; hipDeviceptr_t dstDevice; - hArray * dstArray; - void* reserved1; - size_t dstPitch; - size_t dstHeight; - size_t WidthInBytes; - size_t Height; - size_t Depth; + hArray dstArray; + unsigned int dstPitch; + unsigned int dstHeight; + unsigned int WidthInBytes; + unsigned int Height; + unsigned int Depth; } HIP_MEMCPY3D; typedef struct HIP_MEMCPY3D_PEER_st { @@ -879,7 +877,7 @@ typedef struct HIP_RESOURCE_DESC_st { hipResourceType resType; union { struct { - hArray * h_Array; + hArray h_Array; } array; struct { hipMipmappedArray_t hMipmappedArray; diff --git a/intern/cycles/device/hip/device_impl.cpp b/intern/cycles/device/hip/device_impl.cpp index d7f68934b46..78ccf318cf8 100644 --- a/intern/cycles/device/hip/device_impl.cpp +++ b/intern/cycles/device/hip/device_impl.cpp @@ -990,16 +990,16 @@ void HIPDevice::tex_alloc(device_texture &mem) << string_human_readable_number(mem.memory_size()) << " bytes. (" << string_human_readable_size(mem.memory_size()) << ")"; - hip_assert(hipArray3DCreate(&array_3d, &desc)); + hip_assert(hipArray3DCreate((hArray*)&array_3d, &desc)); if (!array_3d) { return; } HIP_MEMCPY3D param; - memset(¶m, 0, sizeof(param)); + memset(¶m, 0, sizeof(HIP_MEMCPY3D)); param.dstMemoryType = hipMemoryTypeArray; - param.dstArray = &array_3d; + param.dstArray = array_3d; param.srcMemoryType = hipMemoryTypeHost; param.srcHost = mem.host_pointer; param.srcPitch = src_pitch; @@ -1065,13 +1065,13 @@ void HIPDevice::tex_alloc(device_texture &mem) if (mem.info.data_type != IMAGE_DATA_TYPE_NANOVDB_FLOAT && mem.info.data_type != IMAGE_DATA_TYPE_NANOVDB_FLOAT3) { - /* Kepler+, bindless textures. */ + /* Bindless textures. */ hipResourceDesc resDesc; memset(&resDesc, 0, sizeof(resDesc)); if (array_3d) { resDesc.resType = hipResourceTypeArray; - resDesc.res.array.h_Array = &array_3d; + resDesc.res.array.h_Array = array_3d; resDesc.flags = 0; } else if (mem.data_height > 0) { |