[Bf-blender-cvs] [fbb4be061c7] blender-v2.79-release: Cycles: Safer fix for infinite recursion

Sergey Sharybin noreply at git.blender.org
Fri Sep 8 14:47:38 CEST 2017


Commit: fbb4be061c7ae049c6b1fded43894de18b3afd33
Author: Sergey Sharybin
Date:   Fri Sep 8 14:45:07 2017 +0200
Branches: blender-v2.79-release
https://developer.blender.org/rBfbb4be061c7ae049c6b1fded43894de18b3afd33

Cycles: Safer fix for infinite recursion

Previous fix wasn't working correct for certain compiler and CPU intrinsics
mode, causing quite some crashes.

This should be a safer fix, which is closer in behavior to previous release
but which should still fix issues with robust curve intersection.

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

M	intern/cycles/bvh/bvh4.cpp

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

diff --git a/intern/cycles/bvh/bvh4.cpp b/intern/cycles/bvh/bvh4.cpp
index 3ecea600e1a..78f2c94d39a 100644
--- a/intern/cycles/bvh/bvh4.cpp
+++ b/intern/cycles/bvh/bvh4.cpp
@@ -242,21 +242,23 @@ void BVH4::pack_unaligned_node(int idx,
 		 * so kernel might safely assume there are always 4 child nodes.
 		 */
 
-		data[1][i] = NAN;
-		data[2][i] = NAN;
-		data[3][i] = NAN;
+		const float inf = FLT_MAX / 1000.0f;
 
-		data[4][i] = NAN;
-		data[5][i] = NAN;
-		data[6][i] = NAN;
+		data[1][i] = inf;
+		data[2][i] = 0.0f;
+		data[3][i] = 0.0f;
 
-		data[7][i] = NAN;
-		data[8][i] = NAN;
-		data[9][i] = NAN;
+		data[4][i] = 0.0f;
+		data[5][i] = inf;
+		data[6][i] = 0.0f;
 
-		data[10][i] = NAN;
-		data[11][i] = NAN;
-		data[12][i] = NAN;
+		data[7][i] = 0.0f;
+		data[8][i] = 0.0f;
+		data[9][i] = inf;
+
+		data[10][i] = -inf;
+		data[11][i] = -inf;
+		data[12][i] = -inf;
 
 		data[13][i] = __int_as_float(0);
 	}



More information about the Bf-blender-cvs mailing list