diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-15 15:27:23 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-15 15:35:42 +0300 |
commit | 3130f4167d5466a22aafb246425edf55c19c79c1 (patch) | |
tree | c659b83349d48227d3430be059cca6506db8b39d /intern | |
parent | 10320891f0468716e3f4029c3136f3b86587cef2 (diff) |
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.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/bvh/bvh_build.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp index d6668055574..a0b09c780ce 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 |