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 | |
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')
-rw-r--r-- | intern/cycles/bvh/bvh_build.cpp | 6 | ||||
-rw-r--r-- | intern/cycles/bvh/bvh_params.h | 2 |
2 files changed, 4 insertions, 4 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 */ diff --git a/intern/cycles/bvh/bvh_params.h b/intern/cycles/bvh/bvh_params.h index 2e698a80742..431e42a0d6a 100644 --- a/intern/cycles/bvh/bvh_params.h +++ b/intern/cycles/bvh/bvh_params.h @@ -80,7 +80,7 @@ public: min_leaf_size = 1; max_triangle_leaf_size = 8; - max_curve_leaf_size = 2; + max_curve_leaf_size = 1; top_level = false; use_qbvh = false; |