qbsp: parallelize PartitionSurfaces

This commit is contained in:
Eric Wasylishen 2020-01-29 21:14:55 -07:00
parent 1a161b3ad5
commit d083f0f87f
1 changed files with 6 additions and 2 deletions

View File

@ -23,6 +23,8 @@
#include <qbsp/qbsp.hh>
#include "tbb/task_group.h"
int splitnodes;
static int leaffaces;
@ -970,8 +972,10 @@ PartitionSurfaces(surface_t *surfaces, node_t *node)
}
}
PartitionSurfaces(frontlist, node->children[0]);
PartitionSurfaces(backlist, node->children[1]);
tbb::task_group g;
g.run([&](){ PartitionSurfaces(frontlist, node->children[0]); });
g.run([&](){ PartitionSurfaces(backlist, node->children[1]); });
g.wait();
}