feat: multithread building vbo

This commit is contained in:
parker
2025-08-03 03:47:51 +01:00
parent 488ff9ff72
commit 40c37438ce
4 changed files with 59 additions and 54 deletions

View File

@@ -170,24 +170,25 @@ enzo::geo::HeMesh geo::Geometry::computeHalfEdgeMesh()
return heMesh;
}
unsigned int geo::Geometry::getPrimStartVertex(ga::Offset primOffset)
ga::Offset geo::Geometry::getPrimStartVertex(ga::Offset primOffset) const
{
const ga::Offset handleSize = vertexCountHandlePrim_.getSize();
// TODO: add smarter system to recompute primStarts_, also move to separate function
// if size changed, recompute
if(handleSize!=primStarts_.size())
{
bt::intT primStart = 0;
for(size_t i=0; i<handleSize; ++i)
{
primStarts_.push_back(primStart);
primStart += vertexCountHandlePrim_.getValue(i);
}
}
return primStarts_[primOffset];
}
// TODO: handle this automatically
void geo::Geometry::computePrimStartVertices()
{
const ga::Offset handleSize = vertexCountHandlePrim_.getSize();
bt::intT primStart = 0;
for(size_t i=0; i<handleSize; ++i)
{
primStarts_.push_back(primStart);
primStart += vertexCountHandlePrim_.getValue(i);
}
}
ga::AttributeHandle<int> geo::Geometry::addIntAttribute(ga::AttributeOwner owner, std::string name)