diff --git a/src/shapes/bsplinecurve.cpp b/src/shapes/bsplinecurve.cpp index 79ff5bd43..85bc915d9 100644 --- a/src/shapes/bsplinecurve.cpp +++ b/src/shapes/bsplinecurve.cpp @@ -640,7 +640,8 @@ class BSplineCurve final : public Shape { } std::tuple - cubic_interpolation(const Float v, const UInt32 idx, Mask active) const { + cubic_interpolation(const Float v, const UInt32 prim_idx, Mask active) const { + UInt32 idx = dr::gather(m_indices, prim_idx, active); Point4f c0 = dr::gather(m_control_points, idx + 0, active), c1 = dr::gather(m_control_points, idx + 1, active), c2 = dr::gather(m_control_points, idx + 2, active), diff --git a/src/shapes/linearcurve.cpp b/src/shapes/linearcurve.cpp index b39d70010..12f875e10 100644 --- a/src/shapes/linearcurve.cpp +++ b/src/shapes/linearcurve.cpp @@ -330,8 +330,9 @@ class LinearCurve final : public Shape { // taken into account the changing radius: `v_local` is shifted such // that the normal can be easily computed as `si.p - c`, // where `c = (1 - c_local) * cp1 + v_local * cp2` - Point4f c0 = dr::gather(m_control_points, prim_idx + 0, active), - c1 = dr::gather(m_control_points, prim_idx + 1, active); + UInt32 idx = dr::gather(m_indices, prim_idx, active); + Point4f c0 = dr::gather(m_control_points, idx, active), + c1 = dr::gather(m_control_points, idx + 1, active); Point3f p0 = Point3f(c0.x(), c0.y(), c0.z()), p1 = Point3f(c1.x(), c1.y(), c1.z());