diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-02-21 18:46:16 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-31 11:06:21 +0300 |
commit | 63d017be90aef79492cae298e4c6add9abae067f (patch) | |
tree | 075a9242c24d3f083cb6f716d733382b15d3fb6d /intern/cycles/bvh/bvh_split.cpp | |
parent | e69a0ab5fcd54dbc9e4172739e41650bc07905c6 (diff) |
Cycles: Avoid per-split memory allocation for the new references list
Diffstat (limited to 'intern/cycles/bvh/bvh_split.cpp')
-rw-r--r-- | intern/cycles/bvh/bvh_split.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/intern/cycles/bvh/bvh_split.cpp b/intern/cycles/bvh/bvh_split.cpp index cafee25a462..5d33238912f 100644 --- a/intern/cycles/bvh/bvh_split.cpp +++ b/intern/cycles/bvh/bvh_split.cpp @@ -220,7 +220,8 @@ void BVHSpatialSplit::split(BVHBuild *builder, BVHRange& left, BVHRange& right, * Duplication happens into a temporary pre-allocated vector in order to * reduce number of memmove() calls happening in vector.insert(). */ - vector<BVHReference> new_refs; + vector<BVHReference>& new_refs = storage_->spatial_new_refs; + new_refs.clear(); new_refs.reserve(right_start - left_end); while(left_end < right_start) { /* split reference. */ |