Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/eval/deg_eval.cc
| Context not available. | |||||
| BLI_task_pool_delayed_push_end(pool, thread_id); | BLI_task_pool_delayed_push_end(pool, thread_id); | ||||
| } | } | ||||
| struct CalculatePendingData { | |||||
| Depsgraph *graph; | |||||
| }; | |||||
| static bool check_operation_node_visible(OperationNode *op_node) | static bool check_operation_node_visible(OperationNode *op_node) | ||||
| { | { | ||||
| const ComponentNode *comp_node = op_node->owner; | const ComponentNode *comp_node = op_node->owner; | ||||
| Context not available. | |||||
| return comp_node->affects_directly_visible; | return comp_node->affects_directly_visible; | ||||
| } | } | ||||
| static void calculate_pending_parents_for_node(OperationNode *node) | static void calculate_pending_func(void *__restrict data_v, | ||||
| const int i, | |||||
| const TaskParallelTLS *__restrict /*tls*/) | |||||
| { | { | ||||
| CalculatePendingData *data = (CalculatePendingData *)data_v; | |||||
| Depsgraph *graph = data->graph; | |||||
| OperationNode *node = graph->operations[i]; | |||||
| /* Update counters, applies for both visible and invisible IDs. */ | /* Update counters, applies for both visible and invisible IDs. */ | ||||
| node->num_links_pending = 0; | node->num_links_pending = 0; | ||||
| node->scheduled = false; | node->scheduled = false; | ||||
| Context not available. | |||||
| if (!check_operation_node_visible(from)) { | if (!check_operation_node_visible(from)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* No need to wait for operation which is up to date. */ | /* No need to vait for operation which is up to date. */ | ||||
| if ((from->flag & DEPSOP_FLAG_NEEDS_UPDATE) == 0) { | if ((from->flag & DEPSOP_FLAG_NEEDS_UPDATE) == 0) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| Context not available. | |||||
| static void calculate_pending_parents(Depsgraph *graph) | static void calculate_pending_parents(Depsgraph *graph) | ||||
| { | { | ||||
| for (OperationNode *node : graph->operations) { | const int num_operations = graph->operations.size(); | ||||
| calculate_pending_parents_for_node(node); | CalculatePendingData data; | ||||
| } | data.graph = graph; | ||||
| TaskParallelSettings settings; | |||||
| BLI_parallel_range_settings_defaults(&settings); | |||||
| settings.min_iter_per_thread = 1024; | |||||
| BLI_task_parallel_range(0, num_operations, &data, calculate_pending_func, &settings); | |||||
| } | } | ||||
| static void initialize_execution(DepsgraphEvalState *state, Depsgraph *graph) | static void initialize_execution(DepsgraphEvalState *state, Depsgraph *graph) | ||||
| Context not available. | |||||