[Bf-blender-cvs] [7d4fb6880ed] functions: use BLI::parallel_for when creating tetrahedons
Jacques Lucke
noreply at git.blender.org
Thu Jan 2 17:16:11 CET 2020
Commit: 7d4fb6880eda40fcf98dbfb9ad4553a65ad2c122
Author: Jacques Lucke
Date: Thu Jan 2 17:14:30 2020 +0100
Branches: functions
https://developer.blender.org/rB7d4fb6880eda40fcf98dbfb9ad4553a65ad2c122
use BLI::parallel_for when creating tetrahedons
===================================================================
M source/blender/simulations/bparticles/c_wrapper.cpp
===================================================================
diff --git a/source/blender/simulations/bparticles/c_wrapper.cpp b/source/blender/simulations/bparticles/c_wrapper.cpp
index 1fafeff947c..49790f0b6ea 100644
--- a/source/blender/simulations/bparticles/c_wrapper.cpp
+++ b/source/blender/simulations/bparticles/c_wrapper.cpp
@@ -6,6 +6,7 @@
#include "BLI_timeit.h"
#include "BLI_string.h"
+#include "BLI_parallel.h"
#include "BKE_mesh.h"
#include "BKE_customdata.h"
@@ -17,11 +18,6 @@
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
-#ifdef WITH_TBB
-# define TBB_SUPPRESS_DEPRECATED_MESSAGES 1
-# include "tbb/parallel_for.h"
-#endif
-
#define WRAPPERS(T1, T2) \
inline T1 unwrap(T2 value) \
{ \
@@ -148,14 +144,9 @@ static Mesh *distribute_tetrahedons(ArrayRef<float3> centers,
&mesh->ldata, CD_MLOOPCOL, CD_DEFAULT, nullptr, mesh->totloop, "Color"),
mesh->totloop);
-#if WITH_TBB
- tbb::parallel_for(
- tbb::blocked_range<uint>(0, amount, 1000), [&](const tbb::blocked_range<uint> &range) {
- distribute_tetrahedons_range(mesh, loop_colors, range, centers, scales, colors);
- });
-#else
- distribute_tetrahedons_range(mesh, loop_colors, IndexRange(amount), centers, scales, colors);
-#endif
+ BLI::blocked_parallel_for(IndexRange(amount), 1000, [&](IndexRange range) {
+ distribute_tetrahedons_range(mesh, loop_colors, range, centers, scales, colors);
+ });
return mesh;
}
More information about the Bf-blender-cvs
mailing list