diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-21 14:24:51 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-21 18:33:22 +0300 |
commit | f0a5dc63ff0d4196f2d96b9dd846305834520f95 (patch) | |
tree | 2efa9db5b20469c8ada61e0fb21f0c9c3d329e66 /source/blender | |
parent | bf1dc3967971c882a9179d31a36f03702cbc8e0f (diff) |
Depsgraph: Simplify evaluation function
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval.cc | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index 16e5fc9b4a5..20f15a708ae 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -80,32 +80,14 @@ static void deg_task_run_func(TaskPool *pool, void *taskdata, int thread_id) { - DepsgraphEvalState *state = - reinterpret_cast<DepsgraphEvalState *>(BLI_task_pool_userdata(pool)); - OperationDepsNode *node = reinterpret_cast<OperationDepsNode *>(taskdata); - + void *userdata_v = BLI_task_pool_userdata(pool); + DepsgraphEvalState *state = (DepsgraphEvalState *)userdata_v; + OperationDepsNode *node = (OperationDepsNode *)taskdata; + /* Sanity checks. */ BLI_assert(!node->is_noop() && "NOOP nodes should not actually be scheduled"); - - /* Should only be the case for NOOPs, which never get to this point. */ - BLI_assert(node->evaluate); - - /* Get context. */ - /* TODO: Who initialises this? "Init" operations aren't able to - * initialise it!!! - */ - /* TODO(sergey): We don't use component contexts at this moment. */ - /* ComponentDepsNode *comp = node->owner; */ - BLI_assert(node->owner != NULL); - - /* Since we're not leaving the thread for until the graph branches it is - * possible to have NO-OP on the way. for which evaluate() will be NULL. - * but that's all fine, we'll just scheduler it's children. - */ - if (node->evaluate) { - /* Perform operation. */ - node->evaluate(state->eval_ctx); - } - + /* Perform operation. */ + node->evaluate(state->eval_ctx); + /* Schedule children. */ BLI_task_pool_delayed_push_begin(pool, thread_id); schedule_children(pool, state->graph, node, state->layers, thread_id); BLI_task_pool_delayed_push_end(pool, thread_id); |