From d083f0f87f390497162eae4ab6b9a34d65e1ecd8 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Wed, 29 Jan 2020 21:14:55 -0700 Subject: [PATCH] qbsp: parallelize PartitionSurfaces --- qbsp/solidbsp.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qbsp/solidbsp.cc b/qbsp/solidbsp.cc index 220ad2e9..c9bad28f 100644 --- a/qbsp/solidbsp.cc +++ b/qbsp/solidbsp.cc @@ -23,6 +23,8 @@ #include +#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(); }