diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-03-22 03:13:28 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-03-22 03:30:19 +0300 |
commit | fab14f78542ca040cc1606dbd33a4db6aea5976a (patch) | |
tree | 080478f6ef6b80c43d8529049b19ea75d3f47733 /source/blender/io | |
parent | 976c91cd770f4323d4a5007e5bf444b8c701278b (diff) |
Fix build when using WITH_TBB=OFF after recent changes
And wrap tbb::parallel_sort in blender namespace similar to other TBB
functionality.
Diffstat (limited to 'source/blender/io')
-rw-r--r-- | source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc index 9975f300150..a7508f01b0f 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc +++ b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc @@ -17,6 +17,7 @@ #include "BLI_listbase.h" #include "BLI_map.hh" #include "BLI_math.h" +#include "BLI_sort.hh" #include "DEG_depsgraph_query.h" @@ -27,10 +28,6 @@ #include "obj_export_mesh.hh" -#ifdef WITH_TBB -# include <tbb/parallel_sort.h> -#endif - namespace blender::io::obj { OBJMesh::OBJMesh(Depsgraph *depsgraph, const OBJExportParams &export_params, Object *mesh_object) { @@ -207,11 +204,7 @@ void OBJMesh::calc_poly_order() } const MPoly *mpolys = export_mesh_eval_->mpoly; /* Sort polygons by their material index. */ -#ifdef WITH_TBB - tbb::parallel_sort(poly_order_.begin(), poly_order_.end(), [&](int a, int b) { -#else - std::sort(poly_order_.begin(), poly_order_.end(), [&](const Vert *a, const Vert *b) { -#endif + blender::parallel_sort(poly_order_.begin(), poly_order_.end(), [&](int a, int b) { int mat_a = mpolys[a].mat_nr; int mat_b = mpolys[b].mat_nr; return mat_a < mat_b; |