[Bf-blender-cvs] [f61f26b033f] master: Fix Cycles Embree hair + motion blur failing after recent Catmull-Rom change

Brecht Van Lommel noreply at git.blender.org
Mon Feb 24 20:37:45 CET 2020


Commit: f61f26b033fd7d9c8b8bbf8b77cb24ef902f5ba8
Author: Brecht Van Lommel
Date:   Mon Feb 24 20:29:01 2020 +0100
Branches: master
https://developer.blender.org/rBf61f26b033fd7d9c8b8bbf8b77cb24ef902f5ba8

Fix Cycles Embree hair + motion blur failing after recent Catmull-Rom change

Ref T73778

===================================================================

M	intern/cycles/bvh/bvh_embree.cpp

===================================================================

diff --git a/intern/cycles/bvh/bvh_embree.cpp b/intern/cycles/bvh/bvh_embree.cpp
index f621c5c0dd4..639dfe3cee2 100644
--- a/intern/cycles/bvh/bvh_embree.cpp
+++ b/intern/cycles/bvh/bvh_embree.cpp
@@ -728,8 +728,9 @@ void BVHEmbree::update_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair
   }
 
   /* Catmull-Rom splines need extra CVs at the beginning and end of each curve. */
+  size_t num_keys_embree = num_keys;
   if (use_curves) {
-    num_keys += num_curves * 2;
+    num_keys_embree += num_curves * 2;
   }
 
   /* Copy the CV data to Embree */
@@ -746,7 +747,7 @@ void BVHEmbree::update_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair
     }
 
     float4 *rtc_verts = (float4 *)rtcSetNewGeometryBuffer(
-        geom_id, RTC_BUFFER_TYPE_VERTEX, t, RTC_FORMAT_FLOAT4, sizeof(float) * 4, num_keys);
+        geom_id, RTC_BUFFER_TYPE_VERTEX, t, RTC_FORMAT_FLOAT4, sizeof(float) * 4, num_keys_embree);
 
     assert(rtc_verts);
     if (rtc_verts) {
@@ -767,7 +768,7 @@ void BVHEmbree::update_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair
         }
       }
       else {
-        for (size_t j = 0; j < num_keys; ++j) {
+        for (size_t j = 0; j < num_keys_embree; ++j) {
           rtc_verts[j] = float3_to_float4(verts[j]);
           rtc_verts[j].w = curve_radius[j];
         }



More information about the Bf-blender-cvs mailing list