diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_nodes_evaluator.cc')
-rw-r--r-- | source/blender/modifiers/intern/MOD_nodes_evaluator.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc index bcd10cdbf33..3de7497ae3f 100644 --- a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc +++ b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc @@ -352,7 +352,7 @@ class GeometryNodesEvaluator { * on cache line boundaries. Note, just because a value is allocated in one specific thread, * does not mean that it will only be used by that thread. */ - EnumerableThreadSpecific<LinearAllocator<>> local_allocators_; + threading::EnumerableThreadSpecific<LinearAllocator<>> local_allocators_; /** * Every node that is reachable from the output gets its own state. Once all states have been @@ -426,12 +426,13 @@ class GeometryNodesEvaluator { /* Initialize the more complex parts of the node states in parallel. At this point no new * node states are added anymore, so it is safe to lookup states from `node_states_` from * multiple threads. */ - parallel_for(IndexRange(node_states_.size()), 50, [&, this](const IndexRange range) { - LinearAllocator<> &allocator = this->local_allocators_.local(); - for (const NodeWithState &item : node_states_.as_span().slice(range)) { - this->initialize_node_state(item.node, *item.state, allocator); - } - }); + threading::parallel_for( + IndexRange(node_states_.size()), 50, [&, this](const IndexRange range) { + LinearAllocator<> &allocator = this->local_allocators_.local(); + for (const NodeWithState &item : node_states_.as_span().slice(range)) { + this->initialize_node_state(item.node, *item.state, allocator); + } + }); } void initialize_node_state(const DNode node, NodeState &node_state, LinearAllocator<> &allocator) @@ -507,11 +508,12 @@ class GeometryNodesEvaluator { void destruct_node_states() { - parallel_for(IndexRange(node_states_.size()), 50, [&, this](const IndexRange range) { - for (const NodeWithState &item : node_states_.as_span().slice(range)) { - this->destruct_node_state(item.node, *item.state); - } - }); + threading::parallel_for( + IndexRange(node_states_.size()), 50, [&, this](const IndexRange range) { + for (const NodeWithState &item : node_states_.as_span().slice(range)) { + this->destruct_node_state(item.node, *item.state); + } + }); } void destruct_node_state(const DNode node, NodeState &node_state) |