From 3130f4167d5466a22aafb246425edf55c19c79c1 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 15 Apr 2016 14:27:23 +0200 Subject: 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. --- intern/cycles/bvh/bvh_build.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'intern/cycles/bvh/bvh_build.cpp') 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 -- cgit v1.2.3