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:
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_tag.cc')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_tag.cc85
1 files changed, 54 insertions, 31 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 9cd5980d8fe..0c003cf23b2 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -220,17 +220,28 @@ void depsgraph_tag_to_component_opcode(const ID *id,
*component_type = NodeType::NTREE_OUTPUT;
*operation_code = OperationCode::NTREE_OUTPUT;
break;
+
+ case ID_RECALC_PROVISION_26:
+ case ID_RECALC_PROVISION_27:
+ case ID_RECALC_PROVISION_28:
+ case ID_RECALC_PROVISION_29:
+ case ID_RECALC_PROVISION_30:
+ case ID_RECALC_PROVISION_31:
+ /* Silently ignore.
+ * The bits might be passed here from ID_RECALC_ALL. This is not a code-mistake, but just the
+ * way how the recalc flags are handled. */
+ break;
}
}
void id_tag_update_ntree_special(
- Main *bmain, Depsgraph *graph, ID *id, int flag, eUpdateSource update_source)
+ Main *bmain, Depsgraph *graph, ID *id, uint flags, eUpdateSource update_source)
{
bNodeTree *ntree = ntreeFromID(id);
if (ntree == nullptr) {
return;
}
- graph_id_tag_update(bmain, graph, &ntree->id, flag, update_source);
+ graph_id_tag_update(bmain, graph, &ntree->id, flags, update_source);
}
void depsgraph_update_editors_tag(Main *bmain, Depsgraph *graph, ID *id)
@@ -407,13 +418,13 @@ string stringify_append_bit(const string &str, IDRecalcFlag tag)
return result;
}
-string stringify_update_bitfield(int flag)
+string stringify_update_bitfield(uint flags)
{
- if (flag == 0) {
+ if (flags == 0) {
return "LEGACY_0";
}
string result;
- int current_flag = flag;
+ uint current_flag = flags;
/* Special cases to avoid ALL flags form being split into
* individual bits. */
if ((current_flag & ID_RECALC_PSYS_ALL) == ID_RECALC_PSYS_ALL) {
@@ -421,7 +432,7 @@ string stringify_update_bitfield(int flag)
}
/* Handle all the rest of the flags. */
while (current_flag != 0) {
- IDRecalcFlag tag = (IDRecalcFlag)(1 << bitscan_forward_clear_i(&current_flag));
+ IDRecalcFlag tag = (IDRecalcFlag)(1 << bitscan_forward_clear_uint(&current_flag));
result = stringify_append_bit(result, tag);
}
return result;
@@ -449,7 +460,7 @@ int deg_recalc_flags_for_legacy_zero()
ID_RECALC_SOURCE | ID_RECALC_EDITORS);
}
-int deg_recalc_flags_effective(Depsgraph *graph, int flags)
+int deg_recalc_flags_effective(Depsgraph *graph, uint flags)
{
if (graph != nullptr) {
if (!graph->is_active) {
@@ -520,12 +531,12 @@ void graph_tag_ids_for_visible_update(Depsgraph *graph)
* No need bother with it to tag or anything. */
continue;
}
- int flag = 0;
+ uint flags = 0;
if (!deg::deg_copy_on_write_is_expanded(id_node->id_cow)) {
- flag |= ID_RECALC_COPY_ON_WRITE;
+ flags |= ID_RECALC_COPY_ON_WRITE;
if (do_time) {
if (BKE_animdata_from_id(id_node->id_orig) != nullptr) {
- flag |= ID_RECALC_ANIMATION;
+ flags |= ID_RECALC_ANIMATION;
}
}
}
@@ -542,9 +553,9 @@ void graph_tag_ids_for_visible_update(Depsgraph *graph)
*
* TODO(sergey): Need to generalize this somehow. */
if (id_type == ID_OB) {
- flag |= ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY;
+ flags |= ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY;
}
- graph_id_tag_update(bmain, graph, id_node->id_orig, flag, DEG_UPDATE_SOURCE_VISIBILITY);
+ graph_id_tag_update(bmain, graph, id_node->id_orig, flags, DEG_UPDATE_SOURCE_VISIBILITY);
if (id_type == ID_SCE) {
/* Make sure collection properties are up to date. */
id_node->tag_update(graph, DEG_UPDATE_SOURCE_VISIBILITY);
@@ -614,20 +625,20 @@ NodeType geometry_tag_to_component(const ID *id)
return NodeType::UNDEFINED;
}
-void id_tag_update(Main *bmain, ID *id, int flag, eUpdateSource update_source)
+void id_tag_update(Main *bmain, ID *id, uint flags, eUpdateSource update_source)
{
- graph_id_tag_update(bmain, nullptr, id, flag, update_source);
+ graph_id_tag_update(bmain, nullptr, id, flags, update_source);
for (deg::Depsgraph *depsgraph : deg::get_all_registered_graphs(bmain)) {
- graph_id_tag_update(bmain, depsgraph, id, flag, update_source);
+ graph_id_tag_update(bmain, depsgraph, id, flags, update_source);
}
/* Accumulate all tags for an ID between two undo steps, so they can be
* replayed for undo. */
- id->recalc_after_undo_push |= deg_recalc_flags_effective(nullptr, flag);
+ id->recalc_after_undo_push |= deg_recalc_flags_effective(nullptr, flags);
}
void graph_id_tag_update(
- Main *bmain, Depsgraph *graph, ID *id, int flag, eUpdateSource update_source)
+ Main *bmain, Depsgraph *graph, ID *id, uint flags, eUpdateSource update_source)
{
const int debug_flags = (graph != nullptr) ? DEG_debug_flags_get((::Depsgraph *)graph) : G.debug;
if (graph != nullptr && graph->is_evaluating) {
@@ -640,20 +651,20 @@ void graph_id_tag_update(
printf("%s: id=%s flags=%s source=%s\n",
__func__,
id->name,
- stringify_update_bitfield(flag).c_str(),
+ stringify_update_bitfield(flags).c_str(),
update_source_as_string(update_source));
}
IDNode *id_node = (graph != nullptr) ? graph->find_id_node(id) : nullptr;
if (graph != nullptr) {
DEG_graph_id_type_tag(reinterpret_cast<::Depsgraph *>(graph), GS(id->name));
}
- if (flag == 0) {
+ if (flags == 0) {
deg_graph_node_tag_zero(bmain, graph, id_node, update_source);
}
/* Store original flag in the ID.
* Allows to have more granularity than a node-factory based flags. */
if (id_node != nullptr) {
- id_node->id_cow->recalc |= flag;
+ id_node->id_cow->recalc |= flags;
}
/* When ID is tagged for update based on an user edits store the recalc flags in the original ID.
* This way IDs in the undo steps will have this flag preserved, making it possible to restore
@@ -663,20 +674,20 @@ void graph_id_tag_update(
* usually newly created dependency graph skips animation update to avoid loss of unkeyed
* changes). */
if (update_source == DEG_UPDATE_SOURCE_USER_EDIT) {
- id->recalc |= deg_recalc_flags_effective(graph, flag);
+ id->recalc |= deg_recalc_flags_effective(graph, flags);
}
- int current_flag = flag;
+ uint current_flag = flags;
while (current_flag != 0) {
- IDRecalcFlag tag = (IDRecalcFlag)(1 << bitscan_forward_clear_i(&current_flag));
+ IDRecalcFlag tag = (IDRecalcFlag)(1 << bitscan_forward_clear_uint(&current_flag));
graph_id_tag_update_single_flag(bmain, graph, id, id_node, tag, update_source);
}
/* Special case for nested node tree data-blocks. */
- id_tag_update_ntree_special(bmain, graph, id, flag, update_source);
+ id_tag_update_ntree_special(bmain, graph, id, flags, update_source);
/* Direct update tags means that something outside of simulated/cached
* physics did change and that cache is to be invalidated.
* This is only needed if data changes. If it's just a drawing, we keep the
* point cache. */
- if (update_source == DEG_UPDATE_SOURCE_USER_EDIT && flag != ID_RECALC_SHADING) {
+ if (update_source == DEG_UPDATE_SOURCE_USER_EDIT && flags != ID_RECALC_SHADING) {
graph_id_tag_update_single_flag(
bmain, graph, id, id_node, ID_RECALC_POINT_CACHE, update_source);
}
@@ -741,33 +752,45 @@ const char *DEG_update_tag_as_string(IDRecalcFlag flag)
return "TAG_FOR_UNDO";
case ID_RECALC_NTREE_OUTPUT:
return "ID_RECALC_NTREE_OUTPUT";
+
+ case ID_RECALC_PROVISION_26:
+ case ID_RECALC_PROVISION_27:
+ case ID_RECALC_PROVISION_28:
+ case ID_RECALC_PROVISION_29:
+ case ID_RECALC_PROVISION_30:
+ case ID_RECALC_PROVISION_31:
+ /* Silently return nullptr, indicating that there is no string representation.
+ *
+ * This is needed due to the way how logging for ID_RECALC_ALL works: it iterates over all
+ * bits and converts then to string. */
+ return nullptr;
}
return nullptr;
}
/* Data-Based Tagging. */
-void DEG_id_tag_update(ID *id, int flag)
+void DEG_id_tag_update(ID *id, uint flags)
{
- DEG_id_tag_update_ex(G.main, id, flag);
+ DEG_id_tag_update_ex(G.main, id, flags);
}
-void DEG_id_tag_update_ex(Main *bmain, ID *id, int flag)
+void DEG_id_tag_update_ex(Main *bmain, ID *id, uint flags)
{
if (id == nullptr) {
/* Ideally should not happen, but old depsgraph allowed this. */
return;
}
- deg::id_tag_update(bmain, id, flag, deg::DEG_UPDATE_SOURCE_USER_EDIT);
+ deg::id_tag_update(bmain, id, flags, deg::DEG_UPDATE_SOURCE_USER_EDIT);
}
void DEG_graph_id_tag_update(struct Main *bmain,
struct Depsgraph *depsgraph,
struct ID *id,
- int flag)
+ uint flags)
{
deg::Depsgraph *graph = (deg::Depsgraph *)depsgraph;
- deg::graph_id_tag_update(bmain, graph, id, flag, deg::DEG_UPDATE_SOURCE_USER_EDIT);
+ deg::graph_id_tag_update(bmain, graph, id, flags, deg::DEG_UPDATE_SOURCE_USER_EDIT);
}
void DEG_time_tag_update(struct Main *bmain)