[Bf-blender-cvs] [0421ae056d] master: Cycles: Change confusing logic of max leaf size check
Sergey Sharybin
noreply at git.blender.org
Thu Jan 12 18:27:26 CET 2017
Commit: 0421ae056d8ebb7e10894e39d86334b41c061f39
Author: Sergey Sharybin
Date: Thu Jan 12 15:48:21 2017 +0100
Branches: master
https://developer.blender.org/rB0421ae056d8ebb7e10894e39d86334b41c061f39
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.
===================================================================
M intern/cycles/bvh/bvh_build.cpp
M intern/cycles/bvh/bvh_params.h
===================================================================
diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp
index 14f66aca70..d283cdaf9d 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 2e698a8074..431e42a0d6 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;
More information about the Bf-blender-cvs
mailing list