diff --git a/intern/cycles/device/hiprt/device_impl.cpp b/intern/cycles/device/hiprt/device_impl.cpp index b57457ffe9a..bc402453ff4 100644 --- a/intern/cycles/device/hiprt/device_impl.cpp +++ b/intern/cycles/device/hiprt/device_impl.cpp @@ -452,7 +452,7 @@ hiprtGeometryBuildInput HIPRTDevice::prepare_triangle_blas(BVHHIPRT *bvh, Mesh * } } - bvh->custom_prim_aabb.aabbCount = bvh->custom_primitive_bound.size(); + bvh->custom_prim_aabb.aabbCount = num_bounds; bvh->custom_prim_aabb.aabbStride = sizeof(BoundBox); bvh->custom_primitive_bound.copy_to_device(); bvh->custom_prim_aabb.aabbs = (void *)bvh->custom_primitive_bound.device_pointer; @@ -726,7 +726,7 @@ hiprtGeometryBuildInput HIPRTDevice::prepare_point_blas(BVHHIPRT *bvh, PointClou } } - bvh->custom_prim_aabb.aabbCount = bvh->custom_primitive_bound.size(); + bvh->custom_prim_aabb.aabbCount = num_bounds; bvh->custom_prim_aabb.aabbStride = sizeof(BoundBox); bvh->custom_primitive_bound.copy_to_device(); bvh->custom_prim_aabb.aabbs = (void *)bvh->custom_primitive_bound.device_pointer;