diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-01-12 17:48:21 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-01-12 18:33:08 +0300 |
commit | 0421ae056d8ebb7e10894e39d86334b41c061f39 (patch) | |
tree | 68ae0f87e7e44640f330c7d3a8751ebb0b095fad /intern/cycles/bvh/bvh_build.cpp | |
parent | d9cd9ff322f3d4b6b055627ccd1e7a556e6b91d4 (diff) |
Cycles: Change confusing logic of max leaf size check
Maximal number of elements is supposed to be inclusive. That is what
it was always meant in this file and what @brecht considered still
the case in 6974b69c6172.
In fact, the commit message to that change mentions that we allowed
up to 2 curve primitives per leaf while in fact it was doing up to 1
curve primitive.
Making it real 2 primitives at a max gives about 5% slowdown for the
koro.blend scene. This is a reason why BVHParams.max_curve_leaf_size
was changed to 1 by this change.
Diffstat (limited to 'intern/cycles/bvh/bvh_build.cpp')
-rw-r--r-- | intern/cycles/bvh/bvh_build.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp index 14f66aca70f..d283cdaf9d7 100644 --- a/intern/cycles/bvh/bvh_build.cpp +++ b/intern/cycles/bvh/bvh_build.cpp @@ -449,9 +449,9 @@ bool BVHBuild::range_within_max_leaf_size(const BVHRange& range, num_triangles++; } - return (num_triangles < params.max_triangle_leaf_size) && - (num_curves < params.max_curve_leaf_size) && - (num_motion_curves < params.max_curve_leaf_size); + return (num_triangles <= params.max_triangle_leaf_size) && + (num_curves <= params.max_curve_leaf_size) && + (num_motion_curves <= params.max_curve_leaf_size); } /* multithreaded binning builder */ |