diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-04-09 16:51:44 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2020-04-09 20:18:14 +0300 |
commit | 78f56d5582d71e001cc1326b7182aa39f9bdedec (patch) | |
tree | 4d7a1d97a4691302d912da441d072a6b511d554d /source/blender/editors | |
parent | 862ec829422241878b3345661476d8551935aed2 (diff) |
TaskScheduler: Minor Preparations for TBB
Tasks: move priority from task to task pool {rBf7c18df4f599fe39ffc914e645e504fcdbee8636}
Tasks: split task.c into task_pool.cc and task_iterator.c {rB4ada1d267749931ca934a74b14a82479bcaa92e0}
Differential Revision: https://developer.blender.org/D7385
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_undo.c | 6 | ||||
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 7 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_editor.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 13 |
6 files changed, 19 insertions, 20 deletions
diff --git a/source/blender/editors/mesh/editmesh_undo.c b/source/blender/editors/mesh/editmesh_undo.c index 1f857ad4710..48ec41027ff 100644 --- a/source/blender/editors/mesh/editmesh_undo.c +++ b/source/blender/editors/mesh/editmesh_undo.c @@ -542,15 +542,15 @@ static void *undomesh_from_editmesh(UndoMesh *um, BMEditMesh *em, Key *key) # ifdef USE_ARRAY_STORE_THREAD if (um_arraystore.task_pool == NULL) { TaskScheduler *scheduler = BLI_task_scheduler_get(); - um_arraystore.task_pool = BLI_task_pool_create_background(scheduler, NULL); + um_arraystore.task_pool = BLI_task_pool_create_background( + scheduler, NULL, TASK_PRIORITY_LOW); } struct UMArrayData *um_data = MEM_mallocN(sizeof(*um_data), __func__); um_data->um = um; um_data->um_ref = um_ref; - BLI_task_pool_push( - um_arraystore.task_pool, um_arraystore_compact_cb, um_data, true, TASK_PRIORITY_LOW); + BLI_task_pool_push(um_arraystore.task_pool, um_arraystore_compact_cb, um_data, true, NULL); # else um_arraystore_compact_with_info(um, um_ref); # endif diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index c23ce8a8a9e..f35f92feaec 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -859,11 +859,12 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op) if (BKE_imtype_is_movie(scene->r.im_format.imtype)) { task_scheduler = BLI_task_scheduler_create(1); oglrender->task_scheduler = task_scheduler; - oglrender->task_pool = BLI_task_pool_create_background(task_scheduler, oglrender); + oglrender->task_pool = BLI_task_pool_create_background( + task_scheduler, oglrender, TASK_PRIORITY_LOW); } else { oglrender->task_scheduler = NULL; - oglrender->task_pool = BLI_task_pool_create(task_scheduler, oglrender); + oglrender->task_pool = BLI_task_pool_create(task_scheduler, oglrender, TASK_PRIORITY_LOW); } oglrender->pool_ok = true; BLI_spin_init(&oglrender->reports_lock); @@ -1123,7 +1124,7 @@ static bool schedule_write_result(OGLRender *oglrender, RenderResult *rr) BLI_condition_wait(&oglrender->task_condition, &oglrender->task_mutex); } BLI_mutex_unlock(&oglrender->task_mutex); - BLI_task_pool_push(oglrender->task_pool, write_result_func, task_data, true, TASK_PRIORITY_LOW); + BLI_task_pool_push(oglrender->task_pool, write_result_func, task_data, true, NULL); return true; } diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 0b99806109a..6af9ec01fc3 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -5617,7 +5617,7 @@ static bool project_paint_op(void *state, const float lastpos[2], const float po if (ps->thread_tot > 1) { scheduler = BLI_task_scheduler_get(); - task_pool = BLI_task_pool_create_suspended(scheduler, NULL); + task_pool = BLI_task_pool_create_suspended(scheduler, NULL, TASK_PRIORITY_HIGH); } image_pool = BKE_image_pool_new(); @@ -5652,8 +5652,7 @@ static bool project_paint_op(void *state, const float lastpos[2], const float po handles[a].pool = image_pool; if (task_pool != NULL) { - BLI_task_pool_push( - task_pool, do_projectpaint_thread, &handles[a], false, TASK_PRIORITY_HIGH); + BLI_task_pool_push(task_pool, do_projectpaint_thread, &handles[a], false, NULL); } } diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index ffc50407917..cce01947ab7 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -961,9 +961,9 @@ static void start_prefetch_threads(MovieClip *clip, queue.do_update = do_update; queue.progress = progress; - task_pool = BLI_task_pool_create(task_scheduler, &queue); + task_pool = BLI_task_pool_create(task_scheduler, &queue, TASK_PRIORITY_LOW); for (i = 0; i < tot_thread; i++) { - BLI_task_pool_push(task_pool, prefetch_task_func, clip, false, TASK_PRIORITY_LOW); + BLI_task_pool_push(task_pool, prefetch_task_func, clip, false, NULL); } BLI_task_pool_work_and_wait(task_pool); BLI_task_pool_free(task_pool); diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 266212fdfd7..3204374b747 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1434,7 +1434,7 @@ static void do_sequence_proxy(void *pjv, queue.do_update = do_update; queue.progress = progress; - task_pool = BLI_task_pool_create(task_scheduler, &queue); + task_pool = BLI_task_pool_create(task_scheduler, &queue, TASK_PRIORITY_LOW); handles = MEM_callocN(sizeof(ProxyThread) * tot_thread, "proxy threaded handles"); for (i = 0; i < tot_thread; i++) { ProxyThread *handle = &handles[i]; @@ -1451,7 +1451,7 @@ static void do_sequence_proxy(void *pjv, handle->distortion = BKE_tracking_distortion_new(&clip->tracking, width, height); } - BLI_task_pool_push(task_pool, proxy_task_func, handle, false, TASK_PRIORITY_LOW); + BLI_task_pool_push(task_pool, proxy_task_func, handle, false, NULL); } BLI_task_pool_work_and_wait(task_pool); diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 778c27e1a17..ac8fa413f07 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1329,7 +1329,7 @@ static void filelist_cache_preview_ensure_running(FileListEntryCache *cache) if (!cache->previews_pool) { TaskScheduler *scheduler = BLI_task_scheduler_get(); - cache->previews_pool = BLI_task_pool_create_background(scheduler, cache); + cache->previews_pool = BLI_task_pool_create_background(scheduler, cache, TASK_PRIORITY_LOW); cache->previews_done = BLI_thread_queue_init(); IMB_thumb_locks_acquire(); @@ -1393,12 +1393,11 @@ static void filelist_cache_previews_push(FileList *filelist, FileDirEntry *entry FileListEntryPreviewTaskData *preview_taskdata = MEM_mallocN(sizeof(*preview_taskdata), __func__); preview_taskdata->preview = preview; - BLI_task_pool_push_ex(cache->previews_pool, - filelist_cache_preview_runf, - preview_taskdata, - true, - filelist_cache_preview_freef, - TASK_PRIORITY_LOW); + BLI_task_pool_push(cache->previews_pool, + filelist_cache_preview_runf, + preview_taskdata, + true, + filelist_cache_preview_freef); } } |