Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-04-15 15:27:23 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-04-15 15:35:42 +0300
commit3130f4167d5466a22aafb246425edf55c19c79c1 (patch)
treec659b83349d48227d3430be059cca6506db8b39d
parent10320891f0468716e3f4029c3136f3b86587cef2 (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.
-rw-r--r--intern/cycles/bvh/bvh_build.cpp3
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