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:
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval.cc7
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_flush.cc38
2 files changed, 32 insertions, 13 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc
index 4c5d68fb7ef..565bb041cb6 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval.cc
@@ -143,15 +143,18 @@ static void calculate_pending_func(void *data_v,
static void calculate_pending_parents(Depsgraph *graph, unsigned int layers)
{
const int num_operations = graph->operations.size();
- const bool do_threads = num_operations > 256;
+ const bool do_threads = (num_operations > 256);
CalculatePengindData data;
data.graph = graph;
data.layers = layers;
+ ParallelRangeSettings settings;
+ BLI_parallel_range_settings_defaults(&settings);
+ settings.use_threading = do_threads;
BLI_task_parallel_range(0,
num_operations,
&data,
calculate_pending_func,
- do_threads);
+ &settings);
}
static void initialize_execution(DepsgraphEvalState *state, Depsgraph *graph)
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
index 546d4e3cf5d..7650e907c0b 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
@@ -106,16 +106,26 @@ void flush_init_id_node_func(void *data_v,
BLI_INLINE void flush_prepare(Depsgraph *graph)
{
- const int num_operations = graph->operations.size();
- BLI_task_parallel_range(0, num_operations,
- graph,
- flush_init_operation_node_func,
- (num_operations > 256));
- const int num_id_nodes = graph->id_nodes.size();
- BLI_task_parallel_range(0, num_id_nodes,
- graph,
- flush_init_id_node_func,
- (num_id_nodes > 256));
+ {
+ const int num_operations = graph->operations.size();
+ ParallelRangeSettings settings;
+ BLI_parallel_range_settings_defaults(&settings);
+ settings.use_threading = (num_operations > 256);
+ BLI_task_parallel_range(0, num_operations,
+ graph,
+ flush_init_operation_node_func,
+ &settings);
+ }
+ {
+ const int num_id_nodes = graph->id_nodes.size();
+ ParallelRangeSettings settings;
+ BLI_parallel_range_settings_defaults(&settings);
+ settings.use_threading = (num_id_nodes > 256);
+ BLI_task_parallel_range(0, num_id_nodes,
+ graph,
+ flush_init_id_node_func,
+ &settings);
+ }
}
BLI_INLINE void flush_schedule_entrypoints(Depsgraph *graph, FlushQueue *queue)
@@ -299,7 +309,13 @@ void deg_graph_clear_tags(Depsgraph *graph)
/* Go over all operation nodes, clearing tags. */
const int num_operations = graph->operations.size();
const bool do_threads = num_operations > 256;
- BLI_task_parallel_range(0, num_operations, graph, graph_clear_func, do_threads);
+ ParallelRangeSettings settings;
+ BLI_parallel_range_settings_defaults(&settings);
+ settings.use_threading = do_threads;
+ BLI_task_parallel_range(0, num_operations,
+ graph,
+ graph_clear_func,
+ &settings);
/* Clear any entry tags which haven't been flushed. */
BLI_gset_clear(graph->entry_tags, NULL);
}