[Bf-blender-cvs] [3130f41] master: Cycles: Optimization to spatial BVH build

Sergey Sharybin noreply at git.blender.org
Fri Apr 15 14:39:07 CEST 2016


Commit: 3130f4167d5466a22aafb246425edf55c19c79c1
Author: Sergey Sharybin
Date:   Fri Apr 15 14:27:23 2016 +0200
Branches: master
https://developer.blender.org/rB3130f4167d5466a22aafb246425edf55c19c79c1

Cycles: Optimization to spatial BVH build

Simple fix: release lock earlier.

Reduces spatial split build time from 96 to 53sec on the Bunny.blend
(using studio Intel for benchmark).

NOTE: Timing difference is not that spectacular when comparing numbers
with builds before memory optimization, but even then it's about 20%
faster build.

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

M	intern/cycles/bvh/bvh_build.cpp

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

diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp
index d666805..a0b09c7 100644
--- a/intern/cycles/bvh/bvh_build.cpp
+++ b/intern/cycles/bvh/bvh_build.cpp
@@ -706,6 +706,7 @@ BVHNode* BVHBuild::create_leaf_node(const BVHRange& range,
 			prim_index.resize(range_end);
 			prim_object.resize(range_end);
 		}
+		spatial_spin_lock.unlock();
 
 		/* Perform actual data copy. */
 		if(new_leaf_data_size > 0) {
@@ -713,8 +714,6 @@ BVHNode* BVHBuild::create_leaf_node(const BVHRange& range,
 			memcpy(&prim_index[start_index], &local_prim_index[0], new_leaf_data_size);
 			memcpy(&prim_object[start_index], &local_prim_object[0], new_leaf_data_size);
 		}
-
-		spatial_spin_lock.unlock();
 	}
 	else {
 		/* For the regular BVH builder we simply copy new data starting at the




More information about the Bf-blender-cvs mailing list