Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.
C++ 3d3d-sculptingcppdear-imguidigital-sculptingfbxgame-developmentgaussian-splattinggltfimage-to-3dmcpopenglopenusdsculptingtext-to-3dunreal-engine
BVH query: guard the work estimate's shift
islandmede94f725ece62
diff --git a/src/core/BVH.cpp b/src/core/BVH.cppindex 9ecfac34..f5eb9fe9 100644--- a/src/core/BVH.cpp+++ b/src/core/BVH.cpp@@ -325,7 +325,7 @@ void BVH::queryVertices(const Mesh& mesh, const glm::vec3& center, float radius,// The set doesn't depend on which thread found what, take() lists it in index order, and the leaves are// joined in task order.size_t work = 0; // triangles under the tasks, roughly- for (uint32_t ni : tasks) work += nodes_[ni].count > 0 ? nodes_[ni].count : mesh.triangleCount() >> depth;+ for (uint32_t ni : tasks) work += nodes_[ni].count > 0 ? nodes_[ni].count : mesh.triangleCount() >> std::min(depth, 63);if (work < kSerialTriangles) { // waking threads would cost morefor (uint32_t root : tasks) walk(root, stack_, queryLeaves_, vertBits_);vertBits_.take(out);