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>2015-02-19 16:58:21 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-02-19 16:58:21 +0300
commit3bc9ac19f5086fa615ee1b109be36bae9bb855f6 (patch)
treebb9a3cb23acbd25aea10c8514e41b89df78696d7 /intern/cycles/bvh
parent0f652501c7b5d0c5d73bf22b9aa56f6a5a645a4b (diff)
Cycles: Free memory used by intermediate BVH vectors earlier
Ideally we should get rid of those temporary vectors anyway, but it's not so trivial because of the alignment. For untl then we'll just have a bit worse solution. This part of code is not the root of the issue of memory spikes for now anyway. But since we're getting rid of temporary memory earlier actual spike is a bit smaller as now. For example in franck_sheep file it's now 5489.69MB vs. previously 5599.90MB.
Diffstat (limited to 'intern/cycles/bvh')
-rw-r--r--intern/cycles/bvh/bvh.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp
index 2e70d61af30..2152349ed49 100644
--- a/intern/cycles/bvh/bvh.cpp
+++ b/intern/cycles/bvh/bvh.cpp
@@ -205,6 +205,9 @@ void BVH::build(Progress& progress)
pack.prim_type = prim_type;
pack.prim_index = prim_index;
pack.prim_object = prim_object;
+ prim_type.free_memory();
+ prim_index.free_memory();
+ prim_object.free_memory();
/* compute SAH */
if(!params.top_level)
@@ -227,7 +230,7 @@ void BVH::build(Progress& progress)
/* pack nodes */
progress.set_substatus("Packing BVH nodes");
pack_nodes(root);
-
+
/* free build nodes */
root->deleteSubtree();