Depsgraph: Simplify evaluation function
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 21 Dec 2017 11:24:51 +0000 (12:24 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 21 Dec 2017 15:33:22 +0000 (16:33 +0100)
source/blender/depsgraph/intern/eval/deg_eval.cc

index 16e5fc9b4a52875d3861fd13a035b58508d117fb..20f15a708ae55dd197adcab3199954ed2faddb0b 100644 (file)
@@ -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);