[Bf-blender-cvs] [65db18fc56c] master: Fix T68868: Assert in depsgraph debugging logs

Sergey Sharybin noreply at git.blender.org
Tue Sep 3 11:06:44 CEST 2019


Commit: 65db18fc56c3f64fad02a3d02cb10b49b13adccc
Author: Sergey Sharybin
Date:   Tue Sep 3 11:05:36 2019 +0200
Branches: master
https://developer.blender.org/rB65db18fc56c3f64fad02a3d02cb10b49b13adccc

Fix T68868: Assert in depsgraph debugging logs

Was happening when tagging for LEGACY_0 was used.

===================================================================

M	source/blender/depsgraph/DEG_depsgraph.h
M	source/blender/depsgraph/intern/depsgraph_tag.cc

===================================================================

diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index fd12f90016b..7553eca9b64 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -108,6 +108,8 @@ void DEG_graph_on_visible_update(struct Main *bmain, Depsgraph *depsgraph, const
 /* Update all dependency graphs when visible scenes/layers changes. */
 void DEG_on_visible_update(struct Main *bmain, const bool do_time);
 
+/* NOTE: Will return NULL if the flag is not known, allowing to gracefully handle situations
+ * when recalc flag has been removed. */
 const char *DEG_update_tag_as_string(IDRecalcFlag flag);
 
 void DEG_id_tag_update(struct ID *id, int flag);
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index b73a3c08e10..72ef495f1d5 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -412,11 +412,15 @@ static void graph_id_tag_update_single_flag(Main *bmain,
 
 string stringify_append_bit(const string &str, IDRecalcFlag tag)
 {
+  const char *tag_name = DEG_update_tag_as_string(tag);
+  if (tag_name == NULL) {
+    return str;
+  }
   string result = str;
   if (!result.empty()) {
     result += ", ";
   }
-  result += DEG_update_tag_as_string(tag);
+  result += tag_name;
   return result;
 }
 
@@ -717,8 +721,7 @@ const char *DEG_update_tag_as_string(IDRecalcFlag flag)
     case ID_RECALC_ALL:
       return "ALL";
   }
-  BLI_assert(!"Unhandled update flag, should never happen!");
-  return "UNKNOWN";
+  return NULL;
 }
 
 /* Data-Based Tagging  */



More information about the Bf-blender-cvs mailing list