[Bf-blender-cvs] [f0a5dc63ff0] master: Depsgraph: Simplify evaluation function

Sergey Sharybin noreply at git.blender.org
Thu Dec 21 16:33:33 CET 2017


Commit: f0a5dc63ff0d4196f2d96b9dd846305834520f95
Author: Sergey Sharybin
Date:   Thu Dec 21 12:24:51 2017 +0100
Branches: master
https://developer.blender.org/rBf0a5dc63ff0d4196f2d96b9dd846305834520f95

Depsgraph: Simplify evaluation function

===================================================================

M	source/blender/depsgraph/intern/eval/deg_eval.cc

===================================================================

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);



More information about the Bf-blender-cvs mailing list