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:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-10-24 19:38:50 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-10-24 22:14:32 +0300
commit97ec802da7a6bd99f79875fce459659f6218862e (patch)
tree7687da897c433805432bf28efa6799deb731b998 /source/blender/depsgraph
parente66084268ccc08bfde4b384211f5a248a805036d (diff)
Depsgraph: fixes for the eval_flags API behavior.
- Use the original ID pointer for lookup in DEG_get_eval_flags_for_id. - When the flags change after a DEG rebuild, tag the object for update. - Instead of mixing int and short in different places, use uint32_t. This fixes text not updating when a Follow Curve reference is set.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/DEG_depsgraph_build.h2
-rw-r--r--source/blender/depsgraph/DEG_depsgraph_query.h2
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder.cc4
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.cc4
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.h2
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc2
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.h2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_build.cc2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_query.cc4
-rw-r--r--source/blender/depsgraph/intern/nodes/deg_node_id.cc1
-rw-r--r--source/blender/depsgraph/intern/nodes/deg_node_id.h3
11 files changed, 20 insertions, 8 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph_build.h b/source/blender/depsgraph/DEG_depsgraph_build.h
index 53138fc7c40..c09c811121b 100644
--- a/source/blender/depsgraph/DEG_depsgraph_build.h
+++ b/source/blender/depsgraph/DEG_depsgraph_build.h
@@ -156,7 +156,7 @@ void DEG_add_object_cache_relation(struct DepsNodeHandle *handle,
eDepsObjectComponentType component,
const char *description);
-void DEG_add_special_eval_flag(struct DepsNodeHandle *handle, struct ID *id, short flag);
+void DEG_add_special_eval_flag(struct DepsNodeHandle *handle, struct ID *id, uint32_t flag);
struct Depsgraph *DEG_get_graph_from_handle(struct DepsNodeHandle *handle);
diff --git a/source/blender/depsgraph/DEG_depsgraph_query.h b/source/blender/depsgraph/DEG_depsgraph_query.h
index 199dccd7900..e3fa30cf688 100644
--- a/source/blender/depsgraph/DEG_depsgraph_query.h
+++ b/source/blender/depsgraph/DEG_depsgraph_query.h
@@ -71,7 +71,7 @@ bool DEG_id_type_updated(const struct Depsgraph *depsgraph, short id_type);
bool DEG_id_type_any_updated(const struct Depsgraph *depsgraph);
/* Get additional evaluation flags for the given ID. */
-short DEG_get_eval_flags_for_id(const struct Depsgraph *graph, struct ID *id);
+uint32_t DEG_get_eval_flags_for_id(const struct Depsgraph *graph, struct ID *id);
/* Get scene the despgraph is created for. */
struct Scene *DEG_get_evaluated_scene(const struct Depsgraph *graph);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc
index 0eb4c69579b..f7b2b482b1f 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder.cc
@@ -138,6 +138,10 @@ void deg_graph_build_finalize(Main *bmain, Depsgraph *graph)
flag |= DEG_TAG_TIME;
}
}
+ /* Tag rebuild if special evaluation flags changed. */
+ if (id_node->eval_flags != id_node->previous_eval_flags) {
+ flag |= DEG_TAG_TRANSFORM | DEG_TAG_GEOMETRY;
+ }
if (!deg_copy_on_write_is_expanded(id_node->id_cow)) {
flag |= DEG_TAG_COPY_ON_WRITE;
/* This means ID is being added to the dependency graph first
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 30301cdf29a..4e6435eacef 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -164,17 +164,20 @@ IDDepsNode *DepsgraphNodeBuilder::add_id_node(ID *id)
IDDepsNode *id_node = NULL;
ID *id_cow = NULL;
IDComponentsMask previously_visible_components_mask = 0;
+ uint32_t previous_eval_flags = 0;
IDInfo *id_info = (IDInfo *)BLI_ghash_lookup(id_info_hash_, id);
if (id_info != NULL) {
id_cow = id_info->id_cow;
previously_visible_components_mask =
id_info->previously_visible_components_mask;
+ previous_eval_flags = id_info->previous_eval_flags;
/* Tag ID info to not free the CoW ID pointer. */
id_info->id_cow = NULL;
}
id_node = graph_->add_id_node(id, id_cow);
id_node->previously_visible_components_mask =
previously_visible_components_mask;
+ id_node->previous_eval_flags = previous_eval_flags;
/* Currently all ID nodes are supposed to have copy-on-write logic.
*
* NOTE: Zero number of components indicates that ID node was just created.
@@ -356,6 +359,7 @@ void DepsgraphNodeBuilder::begin_build()
}
id_info->previously_visible_components_mask =
id_node->visible_components_mask;
+ id_info->previous_eval_flags = id_node->eval_flags;
BLI_ghash_insert(id_info_hash_, id_node->id_orig, id_info);
id_node->id_cow = NULL;
}
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
index 74709f2b57f..4d4939b4dd3 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h
@@ -231,6 +231,8 @@ struct DepsgraphNodeBuilder {
* dependency graph.
*/
IDComponentsMask previously_visible_components_mask;
+ /* Special evaluation flag mask from the previous depsgraph. */
+ uint32_t previous_eval_flags;
};
protected:
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index e0c98b40186..c025bcd41d8 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -286,7 +286,7 @@ void DepsgraphRelationBuilder::add_customdata_mask(const ComponentKey &key, uint
}
}
-void DepsgraphRelationBuilder::add_special_eval_flag(ID *id, short flag)
+void DepsgraphRelationBuilder::add_special_eval_flag(ID *id, uint32_t flag)
{
DEG::IDDepsNode *id_node = graph_->find_id_node(id);
if (id_node == NULL) {
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
index 32330f5680d..e5854fa8d20 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
@@ -201,7 +201,7 @@ struct DepsgraphRelationBuilder
bool check_unique = false);
void add_customdata_mask(const ComponentKey &key, uint64_t mask);
- void add_special_eval_flag(ID *object, short flag);
+ void add_special_eval_flag(ID *object, uint32_t flag);
void build_id(ID *id);
void build_layer_collections(ListBase *lb);
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc
index e38cebbf525..eb125229c6a 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -178,7 +178,7 @@ void DEG_add_bone_relation(DepsNodeHandle *handle,
description);
}
-void DEG_add_special_eval_flag(struct DepsNodeHandle *handle, ID *id, short flag)
+void DEG_add_special_eval_flag(struct DepsNodeHandle *handle, ID *id, uint32_t flag)
{
DEG::DepsNodeHandle *deg_handle = get_handle(handle);
deg_handle->builder->add_special_eval_flag(id, flag);
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc
index 631669babb2..946917afb26 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -100,7 +100,7 @@ bool DEG_id_type_any_updated(const Depsgraph *graph)
return false;
}
-short DEG_get_eval_flags_for_id(const Depsgraph *graph, ID *id)
+uint32_t DEG_get_eval_flags_for_id(const Depsgraph *graph, ID *id)
{
if (graph == NULL) {
/* Happens when converting objects to mesh from a python script
@@ -113,7 +113,7 @@ short DEG_get_eval_flags_for_id(const Depsgraph *graph, ID *id)
}
const DEG::Depsgraph *deg_graph = reinterpret_cast<const DEG::Depsgraph *>(graph);
- const DEG::IDDepsNode *id_node = deg_graph->find_id_node(id);
+ const DEG::IDDepsNode *id_node = deg_graph->find_id_node(DEG_get_original_id(id));
if (id_node == NULL) {
/* TODO(sergey): Does it mean we need to check set scene? */
return 0;
diff --git a/source/blender/depsgraph/intern/nodes/deg_node_id.cc b/source/blender/depsgraph/intern/nodes/deg_node_id.cc
index fbe61544cd0..d8890547f16 100644
--- a/source/blender/depsgraph/intern/nodes/deg_node_id.cc
+++ b/source/blender/depsgraph/intern/nodes/deg_node_id.cc
@@ -103,6 +103,7 @@ void IDDepsNode::init(const ID *id, const char *UNUSED(subdata))
/* Store ID-pointer. */
id_orig = (ID *)id;
eval_flags = 0;
+ previous_eval_flags = 0;
linked_state = DEG_ID_LINKED_INDIRECTLY;
is_directly_visible = true;
diff --git a/source/blender/depsgraph/intern/nodes/deg_node_id.h b/source/blender/depsgraph/intern/nodes/deg_node_id.h
index 359410d0be0..44b4c91de4e 100644
--- a/source/blender/depsgraph/intern/nodes/deg_node_id.h
+++ b/source/blender/depsgraph/intern/nodes/deg_node_id.h
@@ -78,7 +78,8 @@ struct IDDepsNode : public DepsNode {
* TODO(sergey): Only needed for until really granular updates
* of all the entities.
*/
- int eval_flags;
+ uint32_t eval_flags;
+ uint32_t previous_eval_flags;
eDepsNode_LinkedState_Type linked_state;