[Bf-blender-cvs] [fcc2175] master: Fix own mistake in rBd617de965ea20e5d5 from late December 2015.

Bastien Montagne noreply at git.blender.org
Tue May 10 13:10:31 CEST 2016


Commit: fcc2175710fa273ef2b72a39bb7de8880f6e7875
Author: Bastien Montagne
Date:   Tue May 10 12:52:44 2016 +0200
Branches: master
https://developer.blender.org/rBfcc2175710fa273ef2b72a39bb7de8880f6e7875

Fix own mistake in rBd617de965ea20e5d5 from late December 2015.

Brain melt here, intention was to reduce number of tasks in case we have not much chunks of data to loop over,
not to increase it!

Note that this only affected dynamic scheduling.

===================================================================

M	source/blender/blenlib/intern/task.c

===================================================================

diff --git a/source/blender/blenlib/intern/task.c b/source/blender/blenlib/intern/task.c
index 9fefd71..b47931c 100644
--- a/source/blender/blenlib/intern/task.c
+++ b/source/blender/blenlib/intern/task.c
@@ -914,7 +914,7 @@ static void task_parallel_range_ex(
 		state.chunk_size = max_ii(1, (stop - start) / (num_tasks));
 	}
 
-	num_tasks = max_ii(1, (stop - start) / state.chunk_size);
+	num_tasks = min_ii(num_tasks, (stop - start) / state.chunk_size);
 
 	for (i = 0; i < num_tasks; i++) {
 		BLI_task_pool_push(task_pool,




More information about the Bf-blender-cvs mailing list