diff --git a/include/mitsuba/render/kdtree.h b/include/mitsuba/render/kdtree.h index d5eaa84e1..1c6e2a9a3 100644 --- a/include/mitsuba/render/kdtree.h +++ b/include/mitsuba/render/kdtree.h @@ -190,6 +190,8 @@ class OrderedChunkAllocator { template struct ConcurrentVector { ConcurrentVector() : m_size_and_capacity(0) { } + ConcurrentVector(const ConcurrentVector &) = delete; + ConcurrentVector(ConcurrentVector &&) = delete; ~ConcurrentVector() { release(); } void reserve(uint32_t size) { @@ -286,8 +288,8 @@ struct ConcurrentVector { #endif } - uint64_t size() const { - return m_size_and_capacity.load(std::memory_order_acquire); + uint32_t size() const { + return (uint32_t) m_size_and_capacity.load(std::memory_order_acquire); } void release() { @@ -1117,11 +1119,28 @@ template = derived.max_depth() || m_tight_bbox.collapsed()) { + m_depth >= derived.max_depth() || dr::count(m_tight_bbox.max == m_tight_bbox.min) > 1) { make_leaf(std::move(m_indices)); return; }