Blender Git Commit Log

Git Commits -> Revision 68478ae

Revision 68478ae by Sergey Sharybin (master)
June 28, 2015, 16:15 (GMT)
Cycles: Avoid having duplication of BVH arrays during build

Previous idea behind having vector during building and array for actual storage
was needed in order to minimize amount of re-allocations happening during the
build, but it lead to double memory overhead used by those arrays at the vector
to array conversion stage.

Issue with such approach was that for BVH without spatial split size of arrays
is known in advance and it never changes, which made vector to array conversion
totally redundant.

Also after testing with several rather complex from spatial split scenes (such
as trees) it seems even conservative approach of reallocation (when we perform
re-allocation when leaf does not fit into the memory) doesn't give measurable
difference in time.

This makes it so we can switch to array, which will avoid unneeded memory
re-allocations when spatial split is disabled without harming other cases.

it's a bit difficult to measure exact benefit of this change on our production
files here, but depending on the scene it might give quite reasonable memory
save.

Commit Details:

Full Hash: 68478aea016e87e071d550797b36acd32d33bd12
Parent Commit: b506f3d
Lines Changed: +47, -55

3 Modified Paths:

/intern/cycles/bvh/bvh.cpp (+6, -13) (Diff)
/intern/cycles/bvh/bvh_build.cpp (+32, -32) (Diff)
/intern/cycles/bvh/bvh_build.h (+9, -10) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021