Fix: Cycles: MetalRT motion curves setup bug

MTLAccelerationStructureMotionCurveGeometryDescriptor.controlPointCount should specify the per-step control point count. Although the previous initialisation wasn't manifesting as incorrect behaviour it was technically wrong.

Pull Request: https://projects.blender.org/blender/blender/pulls/146568
This commit is contained in:
Michael Jones
2025-09-23 12:19:44 +02:00
committed by Michael Jones (Apple)
parent f7c01e8076
commit a14fe128fc

View File

@@ -500,7 +500,8 @@ bool BVHMetal::build_BLAS_hair(Progress &progress,
geomDescCrv.radiusBuffers = [NSArray arrayWithObjects:radius_ptrs.data()
count:radius_ptrs.size()];
geomDescCrv.controlPointCount = cpData.size();
/* controlPointCount should specify the *per-step* control point count. */
geomDescCrv.controlPointCount = cpData.size() / num_motion_steps;
geomDescCrv.controlPointStride = sizeof(float3);
geomDescCrv.controlPointFormat = MTLAttributeFormatFloat3;
geomDescCrv.radiusStride = sizeof(float);