diff options
author | Jacques Lucke <mail@jlucke.com> | 2020-01-02 19:14:30 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2020-01-02 19:14:30 +0300 |
commit | 7d4fb6880eda40fcf98dbfb9ad4553a65ad2c122 (patch) | |
tree | 54796fc6a6789a23afab3f329f68ab41a2793c15 /source/blender/simulations/bparticles | |
parent | d238e6410f63d4a1c82f04b0ba909c5831d34eeb (diff) |
use BLI::parallel_for when creating tetrahedons
Diffstat (limited to 'source/blender/simulations/bparticles')
-rw-r--r-- | source/blender/simulations/bparticles/c_wrapper.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
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; } |