[Bf-blender-cvs] [e640664cf85] temp-studio-sprite-fright-cycles: Fix Cycles crash in certain hair configurations

Sergey Sharybin noreply at git.blender.org
Wed Sep 29 17:18:23 CEST 2021


Commit: e640664cf859d5cecc4f449f7ca84bf3b4557fd9
Author: Sergey Sharybin
Date:   Wed Sep 29 12:51:48 2021 +0200
Branches: temp-studio-sprite-fright-cycles
https://developer.blender.org/rBe640664cf859d5cecc4f449f7ca84bf3b4557fd9

Fix Cycles crash in certain hair configurations

The issue was caused by hair shader setup setting normal to a non
finite value, which then gets used to create a ray with non-finite
direction, making BVH traversal to run out of stack memory.

Happens with 150_0040_A.lighting.blend frame 112 of the Sprites
project.

Differential Revision: https://developer.blender.org/D12692

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

M	intern/cycles/kernel/geom/geom_curve_intersect.h

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

diff --git a/intern/cycles/kernel/geom/geom_curve_intersect.h b/intern/cycles/kernel/geom/geom_curve_intersect.h
index e25bf5b4660..063c72d5d9f 100644
--- a/intern/cycles/kernel/geom/geom_curve_intersect.h
+++ b/intern/cycles/kernel/geom/geom_curve_intersect.h
@@ -711,7 +711,7 @@ ccl_device_inline void curve_shader_setup(KernelGlobals *kg,
 
     P = transform_point(&tfm, P);
     D = transform_direction(&tfm, D * t);
-    D = normalize_len(D, &t);
+    D = safe_normalize_len(D, &t);
   }
 
   int prim = kernel_tex_fetch(__prim_index, isect->prim);



More information about the Bf-blender-cvs mailing list