[Bf-blender-cvs] [1a12201] depsgraph_refactor: Move the evaluation code for operations into the task scheduler.
Lukas Tönne
noreply at git.blender.org
Mon May 26 17:24:27 CEST 2014
Commit: 1a12201a35bdeead7c6d7674b17699af620e7c33
Author: Lukas Tönne
Date: Mon May 26 16:55:58 2014 +0200
https://developer.blender.org/rB1a12201a35bdeead7c6d7674b17699af620e7c33
Move the evaluation code for operations into the task scheduler.
Timing calls are disabled atm, these will go into a dedicated debug
utility class, which can be disabled entirely to avoid any overhead.
===================================================================
M source/blender/depsgraph/intern/depsgraph_eval.cpp
M source/blender/depsgraph/util/depsgraph_util_task.cpp
===================================================================
diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cpp b/source/blender/depsgraph/intern/depsgraph_eval.cpp
index 6fb742a..b69372c 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cpp
@@ -82,43 +82,6 @@ void DEG_threaded_exit(void)
DepsgraphTaskScheduler::exit();
}
-/* *************************************************** */
-/* Evaluation Internals */
-
-/* Perform evaluation of a node
- * < graph: Dependency Graph that operations belong to
- * < node: operation node to evaluate
- * < context_type: the context/purpose that the node is being evaluated for
- */
-// NOTE: this is called by the scheduler on a worker thread
-static void deg_exec_node(Depsgraph *graph, DepsNode *node, eEvaluationContextType context_type)
-{
- /* get context and dispatch */
- if (node->tclass == DEPSNODE_CLASS_OPERATION) {
- OperationDepsNode *op = (OperationDepsNode *)node;
- ComponentDepsNode *com = op->owner;
- void *context = NULL, *item = NULL;
-
- /* get context */
- // TODO: who initialises this? "Init" operations aren't able to initialise it!!!
- BLI_assert(com != NULL);
- context = com->contexts[context_type];
-
- /* get "item" */
- // XXX: not everything will use this - some may want something else!
- item = &op->ptr;
-
- /* take note of current time */
- op->start_time = PIL_check_seconds_timer();
-
- /* perform operation */
- op->evaluate(context, item);
-
- /* note how long this took */
- op->last_time = PIL_check_seconds_timer() - op->start_time;
- }
- /* NOTE: "generic" nodes cannot be executed, but will still end up calling this */
-}
/* *************************************************** */
/* Evaluation Entrypoints */
diff --git a/source/blender/depsgraph/util/depsgraph_util_task.cpp b/source/blender/depsgraph/util/depsgraph_util_task.cpp
index 51de84f..797c5b9 100644
--- a/source/blender/depsgraph/util/depsgraph_util_task.cpp
+++ b/source/blender/depsgraph/util/depsgraph_util_task.cpp
@@ -27,6 +27,8 @@
#include <stdlib.h>
#include "BLI_utildefines.h"
+#include "depsnode_component.h"
+
#include "depsgraph_util_task.h"
/* Task */
@@ -40,7 +42,29 @@ DepsgraphTask::DepsgraphTask(Depsgraph *graph_, OperationDepsNode *node_, eEvalu
void DepsgraphTask::run()
{
- /* XXX TODO */
+ /* get context and dispatch */
+ ComponentDepsNode *comp = node->owner;
+ void *context = NULL, *item = NULL;
+
+ /* get context */
+ // TODO: who initialises this? "Init" operations aren't able to initialise it!!!
+ BLI_assert(comp != NULL);
+ context = comp->contexts[context_type];
+
+ /* get "item" */
+ // XXX: not everything will use this - some may want something else!
+ item = &node->ptr;
+
+ /* take note of current time */
+// node->start_time = PIL_check_seconds_timer();
+
+ /* NOOPs should not be evaluated */
+ BLI_assert(node->evaluate);
+ /* perform operation */
+ node->evaluate(context, item);
+
+ /* note how long this took */
+// node->last_time = PIL_check_seconds_timer() - node->start_time;
}
void DepsgraphTask::schedule_children(DepsgraphTaskPool *pool)
More information about the Bf-blender-cvs
mailing list