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-07-13 16:43:36 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-07-13 16:43:36 +0300
commitc9aef27326d54ed053edb37d27fe5571805139b9 (patch)
tree1455a2f704b8187d3770a009054e880c97edfbc3 /source/blender/depsgraph
parent065cd6e4e4295063bfdf952ffd18931736b065c2 (diff)
Depsgraph: Begin work on making depsgraph per-scene-layer
This is a first step towards proper depsgraph "ownership", where we would allow scene to be in multiple states dependent on active workspace or scene layer. This commit introduces a basic API to get proper dependency graph for a given scene layer. It also renames scene->depsgraph to depsgraph_legacy, so it's easier to search0-n-replace in the future.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_build.cc22
-rw-r--r--source/blender/depsgraph/intern/depsgraph_debug.cc2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_tag.cc12
3 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc
index 88ff1ac0a9c..41934e3e4e6 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -261,8 +261,8 @@ void DEG_relations_tag_update(Main *bmain)
scene != NULL;
scene = (Scene *)scene->id.next)
{
- if (scene->depsgraph != NULL) {
- DEG_graph_tag_relations_update(scene->depsgraph);
+ if (scene->depsgraph_legacy != NULL) {
+ DEG_graph_tag_relations_update(scene->depsgraph_legacy);
}
}
}
@@ -272,14 +272,14 @@ void DEG_relations_tag_update(Main *bmain)
*/
void DEG_scene_relations_update(Main *bmain, Scene *scene)
{
- if (scene->depsgraph == NULL) {
+ if (scene->depsgraph_legacy == NULL) {
/* Rebuild graph from scratch and exit. */
- scene->depsgraph = DEG_graph_new();
- DEG_graph_build_from_scene(scene->depsgraph, bmain, scene);
+ scene->depsgraph_legacy = DEG_graph_new();
+ DEG_graph_build_from_scene(scene->depsgraph_legacy, bmain, scene);
return;
}
- DEG::Depsgraph *graph = reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph);
+ DEG::Depsgraph *graph = reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph_legacy);
if (!graph->need_update) {
/* Graph is up to date, nothing to do. */
return;
@@ -301,17 +301,17 @@ void DEG_scene_relations_update(Main *bmain, Scene *scene)
/* Rebuild dependency graph only for a given scene. */
void DEG_scene_relations_rebuild(Main *bmain, Scene *scene)
{
- if (scene->depsgraph != NULL) {
- DEG_graph_tag_relations_update(scene->depsgraph);
+ if (scene->depsgraph_legacy != NULL) {
+ DEG_graph_tag_relations_update(scene->depsgraph_legacy);
}
DEG_scene_relations_update(bmain, scene);
}
void DEG_scene_graph_free(Scene *scene)
{
- if (scene->depsgraph) {
- DEG_graph_free(scene->depsgraph);
- scene->depsgraph = NULL;
+ if (scene->depsgraph_legacy) {
+ DEG_graph_free(scene->depsgraph_legacy);
+ scene->depsgraph_legacy = NULL;
}
}
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc
index 388b692d742..453bd2aa75f 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.cc
+++ b/source/blender/depsgraph/intern/depsgraph_debug.cc
@@ -91,7 +91,7 @@ bool DEG_debug_scene_relations_validate(Main *bmain,
Depsgraph *depsgraph = DEG_graph_new();
bool valid = true;
DEG_graph_build_from_scene(depsgraph, bmain, scene);
- if (!DEG_debug_compare(depsgraph, scene->depsgraph)) {
+ if (!DEG_debug_compare(depsgraph, scene->depsgraph_legacy)) {
fprintf(stderr, "ERROR! Depsgraph wasn't tagged for update when it should have!\n");
BLI_assert(!"This should not happen!");
valid = false;
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 5b7294d92f9..abf4cba2617 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -230,8 +230,8 @@ void DEG_id_tag_update_ex(Main *bmain, ID *id, int flag)
scene != NULL;
scene = (Scene *)scene->id.next)
{
- if (scene->depsgraph) {
- Depsgraph *graph = scene->depsgraph;
+ if (scene->depsgraph_legacy) {
+ Depsgraph *graph = scene->depsgraph_legacy;
if (flag == 0) {
/* TODO(sergey): Currently blender is still tagging IDs
* for recalc just using flag=0. This isn't totally correct
@@ -294,10 +294,10 @@ void DEG_id_type_tag(Main *bmain, short idtype)
void DEG_ids_flush_tagged(Main *bmain, Scene *scene)
{
/* TODO(sergey): Only visible scenes? */
- if (scene->depsgraph != NULL) {
+ if (scene->depsgraph_legacy != NULL) {
DEG::deg_graph_flush_updates(
bmain,
- reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph));
+ reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph_legacy));
}
}
@@ -305,7 +305,7 @@ void DEG_ids_flush_tagged(Main *bmain, Scene *scene)
void DEG_graph_on_visible_update(Main *bmain, Scene *scene)
{
(void) bmain;
- DEG::Depsgraph *graph = reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph);
+ DEG::Depsgraph *graph = reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph_legacy);
GHASH_FOREACH_BEGIN(DEG::IDDepsNode *, id_node, graph->id_hash)
{
id_node->tag_update(graph);
@@ -319,7 +319,7 @@ void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time))
scene != NULL;
scene = (Scene *)scene->id.next)
{
- if (scene->depsgraph != NULL) {
+ if (scene->depsgraph_legacy != NULL) {
DEG_graph_on_visible_update(bmain, scene);
}
}