[Bf-blender-cvs] [c9d6eb4fb42] master: Depsgraph: Cleanup, promote is_evaluating query

Sergey Sharybin noreply at git.blender.org
Fri Oct 11 10:52:00 CEST 2019


Commit: c9d6eb4fb42b231037b00d64602ab0c589120cbb
Author: Sergey Sharybin
Date:   Thu Oct 10 11:03:58 2019 +0200
Branches: master
https://developer.blender.org/rBc9d6eb4fb42b231037b00d64602ab0c589120cbb

Depsgraph: Cleanup, promote is_evaluating query

This way it might be used for sanity checks in RNA API as well.

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

M	source/blender/blenkernel/intern/DerivedMesh.c
M	source/blender/depsgraph/DEG_depsgraph.h
M	source/blender/depsgraph/intern/depsgraph.cc
M	source/blender/depsgraph/intern/depsgraph.h
M	source/blender/depsgraph/intern/depsgraph_debug.cc
M	source/blender/depsgraph/intern/eval/deg_eval.cc

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

diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 4849d631493..2f61cfcbc15 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -1952,7 +1952,7 @@ Mesh *mesh_get_eval_final(struct Depsgraph *depsgraph,
                           const CustomData_MeshMasks *dataMask)
 {
   /* This function isn't thread-safe and can't be used during evaluation. */
-  BLI_assert(DEG_debug_is_evaluating(depsgraph) == false);
+  BLI_assert(DEG_is_evaluating(depsgraph) == false);
 
   /* Evaluated meshes aren't supposed to be created on original instances. If you do,
    * they aren't cleaned up properly on mode switch, causing crashes, e.g T58150. */
@@ -1985,7 +1985,7 @@ Mesh *mesh_get_eval_deform(struct Depsgraph *depsgraph,
                            const CustomData_MeshMasks *dataMask)
 {
   /* This function isn't thread-safe and can't be used during evaluation. */
-  BLI_assert(DEG_debug_is_evaluating(depsgraph) == false);
+  BLI_assert(DEG_is_evaluating(depsgraph) == false);
 
   /* Evaluated meshes aren't supposed to be created on original instances. If you do,
    * they aren't cleaned up properly on mode switch, causing crashes, e.g T58150. */
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index e44dddbcf54..d5a93d21b99 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -179,14 +179,14 @@ void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSce
 
 /* Evaluation  ----------------------------------- */
 
+bool DEG_is_evaluating(struct Depsgraph *depsgraph);
+
 bool DEG_is_active(const struct Depsgraph *depsgraph);
 void DEG_make_active(struct Depsgraph *depsgraph);
 void DEG_make_inactive(struct Depsgraph *depsgraph);
 
 /* Evaluation Debug ------------------------------ */
 
-bool DEG_debug_is_evaluating(struct Depsgraph *depsgraph);
-
 void DEG_debug_print_begin(struct Depsgraph *depsgraph);
 
 void DEG_debug_print_eval(struct Depsgraph *depsgraph,
diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc
index dcdea87fe1a..8f9595d2476 100644
--- a/source/blender/depsgraph/intern/depsgraph.cc
+++ b/source/blender/depsgraph/intern/depsgraph.cc
@@ -76,7 +76,7 @@ Depsgraph::Depsgraph(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluati
       ctime(BKE_scene_frame_get(scene)),
       scene_cow(NULL),
       is_active(false),
-      debug_is_evaluating(false),
+      is_evaluating(false),
       is_render_pipeline_depsgraph(false)
 {
   BLI_spin_init(&lock);
@@ -334,6 +334,12 @@ void DEG_graph_free(Depsgraph *graph)
   OBJECT_GUARDED_DELETE(deg_depsgraph, Depsgraph);
 }
 
+bool DEG_is_evaluating(struct Depsgraph *depsgraph)
+{
+  DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(depsgraph);
+  return deg_graph->is_evaluating;
+}
+
 bool DEG_is_active(const struct Depsgraph *depsgraph)
 {
   if (depsgraph == NULL) {
diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h
index 30ae4edde34..43829f4e045 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -198,7 +198,7 @@ struct Depsgraph {
   int debug_flags;
   string debug_name;
 
-  bool debug_is_evaluating;
+  bool is_evaluating;
 
   /* Is set to truth for dependency graph which are used for post-processing (compositor and
    * sequencer).
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc
index d079c958e04..bb60db5209c 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.cc
+++ b/source/blender/depsgraph/intern/depsgraph_debug.cc
@@ -246,12 +246,6 @@ void DEG_stats_simple(const Depsgraph *graph,
   }
 }
 
-bool DEG_debug_is_evaluating(struct Depsgraph *depsgraph)
-{
-  DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(depsgraph);
-  return deg_graph->debug_is_evaluating;
-}
-
 static DEG::string depsgraph_name_for_logging(struct Depsgraph *depsgraph)
 {
   const char *name = DEG_debug_name_get(depsgraph);
diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc
index 6b7d102c675..d6b3c54a149 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval.cc
@@ -257,7 +257,7 @@ void deg_evaluate_on_refresh(Depsgraph *graph)
   }
   const bool do_time_debug = ((G.debug & G_DEBUG_DEPSGRAPH_TIME) != 0);
   const double start_time = do_time_debug ? PIL_check_seconds_timer() : 0;
-  graph->debug_is_evaluating = true;
+  graph->is_evaluating = true;
   depsgraph_ensure_view_layer(graph);
   /* Set up evaluation state. */
   DepsgraphEvalState state;
@@ -298,7 +298,7 @@ void deg_evaluate_on_refresh(Depsgraph *graph)
   if (need_free_scheduler) {
     BLI_task_scheduler_free(task_scheduler);
   }
-  graph->debug_is_evaluating = false;
+  graph->is_evaluating = false;
   if (do_time_debug) {
     printf("Depsgraph updated in %f seconds.\n", PIL_check_seconds_timer() - start_time);
   }



More information about the Bf-blender-cvs mailing list