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
This commit is contained in:
@@ -360,7 +360,7 @@ void IMB_processor_apply_threaded(
|
||||
int total_tasks = (buffer_lines + lines_per_task - 1) / lines_per_task;
|
||||
int i, start_line;
|
||||
|
||||
task_pool = BLI_task_pool_create(task_scheduler, do_thread);
|
||||
task_pool = BLI_task_pool_create(task_scheduler, do_thread, TASK_PRIORITY_LOW);
|
||||
|
||||
handles = MEM_callocN(handle_size * total_tasks, "processor apply threaded handles");
|
||||
|
||||
@@ -379,7 +379,7 @@ void IMB_processor_apply_threaded(
|
||||
|
||||
init_handle(handle, start_line, lines_per_current_task, init_customdata);
|
||||
|
||||
BLI_task_pool_push(task_pool, processor_apply_func, handle, false, TASK_PRIORITY_LOW);
|
||||
BLI_task_pool_push(task_pool, processor_apply_func, handle, false, NULL);
|
||||
|
||||
start_line += lines_per_task;
|
||||
}
|
||||
@@ -421,13 +421,10 @@ void IMB_processor_apply_threaded_scanlines(int total_scanlines,
|
||||
data.total_scanlines = total_scanlines;
|
||||
const int total_tasks = (total_scanlines + scanlines_per_task - 1) / scanlines_per_task;
|
||||
TaskScheduler *task_scheduler = BLI_task_scheduler_get();
|
||||
TaskPool *task_pool = BLI_task_pool_create(task_scheduler, &data);
|
||||
TaskPool *task_pool = BLI_task_pool_create(task_scheduler, &data, TASK_PRIORITY_LOW);
|
||||
for (int i = 0, start_line = 0; i < total_tasks; i++) {
|
||||
BLI_task_pool_push(task_pool,
|
||||
processor_apply_scanline_func,
|
||||
POINTER_FROM_INT(start_line),
|
||||
false,
|
||||
TASK_PRIORITY_LOW);
|
||||
BLI_task_pool_push(
|
||||
task_pool, processor_apply_scanline_func, POINTER_FROM_INT(start_line), false, NULL);
|
||||
start_line += scanlines_per_task;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user