diff options
-rw-r--r-- | intern/cycles/bvh/bvh_params.h | 1 | ||||
-rw-r--r-- | intern/cycles/bvh/bvh_split.cpp | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/intern/cycles/bvh/bvh_params.h b/intern/cycles/bvh/bvh_params.h index 2b280d66e4a..2e579ba85a4 100644 --- a/intern/cycles/bvh/bvh_params.h +++ b/intern/cycles/bvh/bvh_params.h @@ -186,6 +186,7 @@ struct BVHSpatialStorage { vector<BoundBox> spatial_right_bounds; BVHSpatialBin spatial_bins[3][BVHParams::NUM_SPATIAL_BINS]; vector<int> spatial_indices; + vector<BVHReference> spatial_new_refs; }; CCL_NAMESPACE_END 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. */ |