diff options
author | mano-wii <germano.costa@ig.com.br> | 2020-01-04 05:06:07 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2020-01-04 05:06:07 +0300 |
commit | 025d13045abec142528f44576bfdcce9ef0da90a (patch) | |
tree | 025c45aece419211f647f0e544017a96136ad412 /source/blender/blenlib/intern/BLI_kdopbvh.c | |
parent | ad6c66fa3e1c21eebf68291ec1b8c9c1b7c5cf0c (diff) |
BLI_bvhtree_overlap: Make sure the number of nodes matches the number of threads
Diffstat (limited to 'source/blender/blenlib/intern/BLI_kdopbvh.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_kdopbvh.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 994fd510ac8..2674e6c61dc 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -1302,7 +1302,8 @@ BVHTreeOverlap *BLI_bvhtree_overlap_ex( /* `RETURN_PAIRS` was not implemented without `max_interations`. */ BLI_assert(overlap_pairs || max_interactions); - const int thread_num = use_threading ? BLI_bvhtree_overlap_thread_num(tree1) : 1; + const int root_node_len = BLI_bvhtree_overlap_thread_num(tree1); + const int thread_num = use_threading ? root_node_len : 1; int j; size_t total = 0; BVHTreeOverlap *overlap = NULL, *to = NULL; @@ -1352,7 +1353,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap_ex( BLI_parallel_range_settings_defaults(&settings); settings.use_threading = use_threading; BLI_task_parallel_range(0, - root1->totnode, + root_node_len, data, max_interactions ? bvhtree_overlap_num_task_cb : bvhtree_overlap_task_cb, &settings); |