Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht>2021-11-27 21:07:53 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-11-27 21:08:06 +0300
commitd2e608733507add9ecc77c122d9f542a80adccbf (patch)
treeffb3cc4345d2ad792a53b3921139c3e1e201db38 /source/blender/blenlib/intern
parent2fb8c6805a982c3b617abc60459c6f40c7a9230c (diff)
Fix build error with TBB 2021 and booleans
Linux distributions are using newer TBB versions than official releases, and TBB 2021 is an API breaking release. In general we should avoid using TBB directly and go through the abstractions in BLI_task.hh, though there is no abstraction for this. For 3.0 the safe option is to just not cancel the task but instead early out in the lambda function. Given the grain size of 2048 there should be no significant performance difference. Differential Revision: https://developer.blender.org/D13382
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r--source/blender/blenlib/intern/mesh_boolean.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/mesh_boolean.cc b/source/blender/blenlib/intern/mesh_boolean.cc
index 8b029d11c3f..20b696bb56f 100644
--- a/source/blender/blenlib/intern/mesh_boolean.cc
+++ b/source/blender/blenlib/intern/mesh_boolean.cc
@@ -1370,6 +1370,11 @@ static bool is_pwn(const IMesh &tm, const TriMeshTopology &tmtopo)
}
threading::parallel_for(tris.index_range(), 2048, [&](IndexRange range) {
+ if (!is_pwn.load()) {
+ /* Early out if mesh is already determined to be non-pwn. */
+ return;
+ }
+
for (int j : range) {
const Edge &edge = tris[j].first;
int tot_orient = 0;
@@ -1395,9 +1400,7 @@ static bool is_pwn(const IMesh &tm, const TriMeshTopology &tmtopo)
std::cout << "edge causing non-pwn: " << edge << "\n";
}
is_pwn = false;
-# ifdef WITH_TBB
- tbb::task::self().cancel_group_execution();
-# endif
+ break;
}
}
});