Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-10-24 16:14:22 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-10-24 17:04:11 +0300
commit72b61763da593fb6a9822f3e37eff9dd2973bf66 (patch)
treefbcc7169990e75410d5eabd132dedb003e635eff /source/blender
parent4dbfb130db1afea2ec4f8d5604515e81e5fde687 (diff)
Depsgraph: Begin bringing API to pass explicit graph
This is a first step towards an updated API where we pass explicit graph rather than a scene. This is because we can no longer deduct which graph to use since it will depend on a context. Will happen in several steps, so bisecting will not be such a pain.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/depsgraph/DEG_depsgraph.h6
-rw-r--r--source/blender/depsgraph/intern/depsgraph_tag.cc16
-rw-r--r--source/blender/makesrna/intern/rna_depsgraph.c2
3 files changed, 10 insertions, 14 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index b76545a2884..34e59966a71 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -134,7 +134,7 @@ void DEG_free_node_types(void);
/* Update Tagging -------------------------------- */
/* Update dependency graph when visible scenes/layers changes. */
-void DEG_graph_on_visible_update(struct Main *bmain, struct Scene *scene);
+void DEG_graph_on_visible_update(struct Main *bmain, Depsgraph *depsgraph);
/* Update all dependency graphs when visible scenes/layers changes. */
void DEG_on_visible_update(struct Main *bmain, const bool do_time);
@@ -167,9 +167,7 @@ enum {
DEG_TAG_SHADING_UPDATE = (1 << 9),
};
void DEG_id_tag_update(struct ID *id, int flag);
-void DEG_id_tag_update_ex(struct Main *bmain,
- struct ID *id,
- int flag);
+void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag);
/* Tag given ID type for update.
*
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 19d3dda1896..cde87ba126c 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -361,7 +361,7 @@ void deg_id_tag_update(Main *bmain, ID *id, int flag)
}
}
-void deg_graph_on_visible_update(Main *bmain, Scene *scene, Depsgraph *graph)
+void deg_graph_on_visible_update(Main *bmain, Depsgraph *graph)
{
/* Make sure objects are up to date. */
GHASH_FOREACH_BEGIN(DEG::IDDepsNode *, id_node, graph->id_hash)
@@ -389,7 +389,7 @@ void deg_graph_on_visible_update(Main *bmain, Scene *scene, Depsgraph *graph)
}
GHASH_FOREACH_END();
/* Make sure collection properties are up to date. */
- IDDepsNode *scene_id_node = graph->find_id_node(&scene->id);
+ IDDepsNode *scene_id_node = graph->find_id_node(&graph->scene->id);
BLI_assert(scene_id_node != NULL);
scene_id_node->tag_update(graph);
}
@@ -436,16 +436,14 @@ void DEG_scene_flush_update(Main *bmain, Scene *scene)
if (scene->depsgraph_legacy == NULL) {
return;
}
- DEG::deg_graph_flush_updates(
- bmain,
- reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph_legacy));
+ DEG::deg_graph_flush_updates(bmain, (DEG::Depsgraph *)scene->depsgraph_legacy);
}
/* Update dependency graph when visible scenes/layers changes. */
-void DEG_graph_on_visible_update(Main *bmain, Scene *scene)
+void DEG_graph_on_visible_update(Main *bmain, Depsgraph *depsgraph)
{
- DEG::Depsgraph *graph = (DEG::Depsgraph *)scene->depsgraph_legacy;
- DEG::deg_graph_on_visible_update(bmain, scene, graph);
+ DEG::Depsgraph *graph = (DEG::Depsgraph *)depsgraph;
+ DEG::deg_graph_on_visible_update(bmain, graph);
}
void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time))
@@ -455,7 +453,7 @@ void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time))
scene = (Scene *)scene->id.next)
{
if (scene->depsgraph_legacy != NULL) {
- DEG_graph_on_visible_update(bmain, scene);
+ DEG_graph_on_visible_update(bmain, scene->depsgraph_legacy);
}
}
}
diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c
index 88a1873c17f..bab718c7235 100644
--- a/source/blender/makesrna/intern/rna_depsgraph.c
+++ b/source/blender/makesrna/intern/rna_depsgraph.c
@@ -141,7 +141,7 @@ static void rna_Depsgraph_debug_rebuild(Depsgraph *UNUSED(graph), bContext *C)
DEG_relations_tag_update(bmain);
for (sce = bmain->scene.first; sce; sce = sce->id.next) {
DEG_scene_relations_rebuild(bmain, sce);
- DEG_graph_on_visible_update(bmain, sce);
+ DEG_graph_on_visible_update(bmain, sce->depsgraph_legacy);
}
}