[Bf-blender-cvs] [ecbfa31] master: Cycles: Tweak empty boundbox children

Sergey Sharybin noreply at git.blender.org
Tue Sep 13 11:10:18 CEST 2016


Commit: ecbfa31caaadb03c53c0fe1459718b99613c8804
Author: Sergey Sharybin
Date:   Tue Sep 13 11:05:11 2016 +0200
Branches: master
https://developer.blender.org/rBecbfa31caaadb03c53c0fe1459718b99613c8804

Cycles: Tweak empty boundbox children

The idea here is to make assert failure to fail sooner on an incorrect
node address rather than later with stack overflow.

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

M	intern/cycles/bvh/bvh.cpp

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

diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp
index 39b2a0c..bb326d4 100644
--- a/intern/cycles/bvh/bvh.cpp
+++ b/intern/cycles/bvh/bvh.cpp
@@ -885,7 +885,7 @@ void QBVH::pack_aligned_node(int idx,
 		data[5][i] = FLT_MAX;
 		data[6][i] = -FLT_MAX;
 
-		data[7][i] = __int_as_float(0);
+		data[7][i] = __int_as_float(INT_MAX);
 	}
 
 	memcpy(&pack.nodes[idx], data, sizeof(float4)*BVH_QNODE_SIZE);
@@ -968,7 +968,7 @@ void QBVH::pack_unaligned_node(int idx,
 		data[11][i] = -FLT_MAX;
 		data[12][i] = -FLT_MAX;
 
-		data[13][i] = __int_as_float(0);
+		data[13][i] = __int_as_float(INT_MAX);
 	}
 
 	memcpy(&pack.nodes[idx], data, sizeof(float4)*BVH_UNALIGNED_QNODE_SIZE);




More information about the Bf-blender-cvs mailing list