diff options
-rw-r--r-- | intern/cycles/bvh/bvh_build.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/bvh/bvh_split.cpp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp index 255051c92dc..d6668055574 100644 --- a/intern/cycles/bvh/bvh_build.cpp +++ b/intern/cycles/bvh/bvh_build.cpp @@ -280,8 +280,8 @@ BVHNode* BVHBuild::run() size_t num_bins = max(root.size(), (int)BVHParams::NUM_SPATIAL_BINS) - 1; foreach(BVHSpatialStorage &storage, spatial_storage) { storage.right_bounds.clear(); - storage.right_bounds.resize(num_bins); } + spatial_storage[0].right_bounds.resize(num_bins); } spatial_free_index = 0; diff --git a/intern/cycles/bvh/bvh_split.cpp b/intern/cycles/bvh/bvh_split.cpp index 7b2e342637f..9185bd99d10 100644 --- a/intern/cycles/bvh/bvh_split.cpp +++ b/intern/cycles/bvh/bvh_split.cpp @@ -54,6 +54,7 @@ BVHObjectSplit::BVHObjectSplit(BVHBuild *builder, /* sweep right to left and determine bounds. */ BoundBox right_bounds = BoundBox::empty; + storage_->right_bounds.resize(range.size()); for(int i = range.size() - 1; i > 0; i--) { right_bounds.grow(ref_ptr[i].bounds()); storage_->right_bounds[i - 1] = right_bounds; @@ -160,6 +161,7 @@ BVHSpatialSplit::BVHSpatialSplit(const BVHBuild& builder, /* sweep right to left and determine bounds. */ BoundBox right_bounds = BoundBox::empty; + storage_->right_bounds.resize(BVHParams::NUM_SPATIAL_BINS); for(int i = BVHParams::NUM_SPATIAL_BINS - 1; i > 0; i--) { right_bounds.grow(storage_->bins[dim][i].bounds); storage_->right_bounds[i - 1] = right_bounds; |