Skip to content

Commit 7b97d19

Browse files
Merge pull request #1079 from Geode-solutions/fix/aabb-async
fix(AABBTree): do not use async tasks for small tree
2 parents 5355b0f + 1936ce9 commit 7b97d19

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

include/geode/geometry/detail/aabb_impl.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,15 @@ namespace geode
9595
bboxes, ROOT_INDEX, 0, bboxes.size() );
9696
}
9797
const auto grain = async::detail::auto_grain_size( bboxes.size() );
98-
const auto nb_async_depth = std::log2( grain );
99-
async_depth_ =
100-
depth_ > nb_async_depth ? depth_ - nb_async_depth : depth_;
98+
if( grain < 8 )
99+
{
100+
async_depth_ = 0;
101+
}
102+
else
103+
{
104+
const auto nb_async_depth = std::log2( grain );
105+
async_depth_ = depth_ - nb_async_depth;
106+
}
101107
}
102108

103109
[[nodiscard]] index_t nb_bboxes() const

0 commit comments

Comments
 (0)