Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-01-09 20:07:34 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-01-09 20:07:34 +0300
commit4a3b303bb03364523a782043e0888d608a3eb6d3 (patch)
tree296715a62815017c7d6606b6859d620f94248632
parent932d448ae013b5425efa974be5a106d9d6a16652 (diff)
Task scheduler: Fix wrong tasks calculation when chunk size is too big
-rw-r--r--source/blender/blenlib/intern/task.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/task.c b/source/blender/blenlib/intern/task.c
index 2c756aa6d65..c82d2298a36 100644
--- a/source/blender/blenlib/intern/task.c
+++ b/source/blender/blenlib/intern/task.c
@@ -1123,7 +1123,8 @@ void BLI_task_parallel_range(const int start, const int stop,
break;
}
- num_tasks = min_ii(num_tasks, (stop - start) / state.chunk_size);
+ num_tasks = min_ii(num_tasks,
+ max_ii(1, (stop - start) / state.chunk_size));
/* TODO(sergey): If number of tasks happened to be 1, use single threaded
* path.