Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/eval/deg_eval.cc
| Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | struct DepsgraphEvalState { | ||||
| bool need_single_thread_pass; | bool need_single_thread_pass; | ||||
| }; | }; | ||||
| void evaluate_node(const DepsgraphEvalState *state, OperationNode *operation_node) | void evaluate_node(const DepsgraphEvalState *state, OperationNode *operation_node) | ||||
| { | { | ||||
| ::Depsgraph *depsgraph = reinterpret_cast<::Depsgraph *>(state->graph); | ::Depsgraph *depsgraph = reinterpret_cast<::Depsgraph *>(state->graph); | ||||
| /* Sanity checks. */ | /* Sanity checks. */ | ||||
| BLI_assert(!operation_node->is_noop() && "NOOP nodes should not actually be scheduled"); | BLI_assert_msg(!operation_node->is_noop(), "NOOP nodes should not actually be scheduled"); | ||||
| /* Perform operation. */ | /* Perform operation. */ | ||||
| if (state->do_stats) { | if (state->do_stats) { | ||||
| const double start_time = PIL_check_seconds_timer(); | const double start_time = PIL_check_seconds_timer(); | ||||
| operation_node->evaluate(depsgraph); | operation_node->evaluate(depsgraph); | ||||
| operation_node->stats.current_time += PIL_check_seconds_timer() - start_time; | operation_node->stats.current_time += PIL_check_seconds_timer() - start_time; | ||||
| } | } | ||||
| else { | else { | ||||
| operation_node->evaluate(depsgraph); | operation_node->evaluate(depsgraph); | ||||
| ▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | case EvaluationStage::THREADED_EVALUATION: | ||||
| state->need_single_thread_pass = true; | state->need_single_thread_pass = true; | ||||
| return false; | return false; | ||||
| } | } | ||||
| return true; | return true; | ||||
| case EvaluationStage::SINGLE_THREADED_WORKAROUND: | case EvaluationStage::SINGLE_THREADED_WORKAROUND: | ||||
| return true; | return true; | ||||
| } | } | ||||
| BLI_assert(!"Unhandled evaluation stage, should never happen."); | BLI_assert_msg(0, "Unhandled evaluation stage, should never happen."); | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* Schedule a node if it needs evaluation. | /* Schedule a node if it needs evaluation. | ||||
| * dec_parents: Decrement pending parents count, true when child nodes are | * dec_parents: Decrement pending parents count, true when child nodes are | ||||
| * scheduled after a task has been completed. | * scheduled after a task has been completed. | ||||
| */ | */ | ||||
| template<typename ScheduleFunction, typename... ScheduleFunctionArgs> | template<typename ScheduleFunction, typename... ScheduleFunctionArgs> | ||||
| ▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines | |||||