diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-09 18:15:33 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-09 18:15:33 +0300 |
commit | 6deb908a5c9f34deb4c19561082b14d8eda51e43 (patch) | |
tree | e72c9fd7b77f486deea839428573c0788c9ceda9 /source/blender/editors/sculpt_paint/sculpt_undo.c | |
parent | 1cab3be7a7af483ed645c2912b3aed3292812746 (diff) | |
parent | 932d448ae013b5425efa974be5a106d9d6a16652 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_undo.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index a10c7477dc6..73aaedc856e 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -319,7 +319,8 @@ static bool sculpt_undo_restore_mask(bContext *C, DerivedMesh *dm, SculptUndoNod return 1; } -static void sculpt_undo_bmesh_restore_generic_task_cb(void *userdata, const int n) +static void sculpt_undo_bmesh_restore_generic_task_cb(void *userdata, const int n, + const ParallelRangeTLS *UNUSED(tls)) { PBVHNode **nodes = userdata; @@ -347,9 +348,14 @@ static void sculpt_undo_bmesh_restore_generic(bContext *C, BKE_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode); + ParallelRangeSettings settings; + BLI_parallel_range_settings_defaults(&settings); + settings.use_threading = ((sd->flags & SCULPT_USE_OPENMP) && totnode > SCULPT_THREADED_LIMIT); BLI_task_parallel_range( - 0, totnode, nodes, sculpt_undo_bmesh_restore_generic_task_cb, - ((sd->flags & SCULPT_USE_OPENMP) && totnode > SCULPT_THREADED_LIMIT)); + 0, totnode, + nodes, + sculpt_undo_bmesh_restore_generic_task_cb, + &settings); if (nodes) MEM_freeN(nodes); |