[Bf-blender-cvs] [ceb612a79c7] master: Revert "Depsgraph: Implement 'ID_RECALC_GEOMETRY_DEFORM'"

Germano Cavalcante noreply at git.blender.org
Mon Jul 19 15:17:49 CEST 2021


Commit: ceb612a79c7c49967fe6976c261ad3f9fa47adfb
Author: Germano Cavalcante
Date:   Mon Jul 19 10:17:38 2021 -0300
Branches: master
https://developer.blender.org/rBceb612a79c7c49967fe6976c261ad3f9fa47adfb

Revert "Depsgraph: Implement 'ID_RECALC_GEOMETRY_DEFORM'"

This reverts commits
 bfa3dc91b75407b063f2ac991b176d98c050f92d,
 52b94049f2a71a74f52247f83657cf3a5c8712b4,
 ae379714e4f1eca74f5f77532a6e959f29445236,
 a770faa811ee62837eb540b0bd83ca0770f16663,
 4ed029fc02b022cb5ff28ed3ce70992c450d2be5,
 101a493ab556c6597ac91fba204059be67b35990 and
 62a2faa7ef39130446716d7a06215cd1df1eb2ac.

And fixes T89955.

Changing the dependency graph is a can of worms and the result is
a kind of unpredictable.

A different solution will be planned.

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

M	source/blender/blenkernel/BKE_mesh_types.h
M	source/blender/blenkernel/BKE_object.h
M	source/blender/blenkernel/intern/object_update.c
M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/depsgraph/intern/depsgraph_tag.cc
M	source/blender/depsgraph/intern/eval/deg_eval_flush.cc
M	source/blender/depsgraph/intern/node/deg_node_operation.cc
M	source/blender/depsgraph/intern/node/deg_node_operation.h
M	source/blender/draw/intern/draw_cache_impl_mesh.c
M	source/blender/editors/transform/transform_convert_mesh.c
M	source/blender/makesdna/DNA_ID.h

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

diff --git a/source/blender/blenkernel/BKE_mesh_types.h b/source/blender/blenkernel/BKE_mesh_types.h
index b223d3872ff..aed8c44a031 100644
--- a/source/blender/blenkernel/BKE_mesh_types.h
+++ b/source/blender/blenkernel/BKE_mesh_types.h
@@ -27,7 +27,6 @@ typedef enum eMeshBatchDirtyMode {
   BKE_MESH_BATCH_DIRTY_SELECT,
   BKE_MESH_BATCH_DIRTY_SELECT_PAINT,
   BKE_MESH_BATCH_DIRTY_SHADING,
-  BKE_MESH_BATCH_DIRTY_DEFORM,
   BKE_MESH_BATCH_DIRTY_UVEDIT_ALL,
   BKE_MESH_BATCH_DIRTY_UVEDIT_SELECT,
 } eMeshBatchDirtyMode;
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index a16822fd7dd..4724e6dfab6 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -374,10 +374,6 @@ void BKE_object_runtime_free_data(struct Object *object);
 
 void BKE_object_batch_cache_dirty_tag(struct Object *ob);
 void BKE_object_data_batch_cache_dirty_tag(struct ID *object_data);
-void BKE_object_data_eval_batch_cache_dirty_tag(struct Depsgraph *depsgraph,
-                                                struct ID *object_data);
-void BKE_object_data_eval_batch_cache_deform_tag(struct Depsgraph *depsgraph,
-                                                 struct ID *object_data);
 
 /* this function returns a superset of the scenes selection based on relationships */
 
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index ab1daededed..7e15ac5de5d 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -388,30 +388,12 @@ void BKE_object_batch_cache_dirty_tag(Object *ob)
   BKE_object_data_batch_cache_dirty_tag(ob->data);
 }
 
-void BKE_object_data_eval_batch_cache_dirty_tag(Depsgraph *depsgraph, ID *object_data)
-{
-  DEG_debug_print_eval(depsgraph, __func__, object_data->name, object_data);
-  BKE_object_data_batch_cache_dirty_tag(object_data);
-}
-
-void BKE_object_data_eval_batch_cache_deform_tag(Depsgraph *depsgraph, ID *object_data)
-{
-  DEG_debug_print_eval(depsgraph, __func__, object_data->name, object_data);
-  switch (GS(object_data->name)) {
-    case ID_ME:
-      BKE_mesh_batch_cache_dirty_tag((Mesh *)object_data, BKE_MESH_BATCH_DIRTY_DEFORM);
-      break;
-    default:
-      /* Only mesh is currently supported. */
-      break;
-  }
-}
-
 void BKE_object_eval_uber_data(Depsgraph *depsgraph, Scene *scene, Object *ob)
 {
   DEG_debug_print_eval(depsgraph, __func__, ob->id.name, ob);
   BLI_assert(ob->type != OB_ARMATURE);
   BKE_object_handle_data_update(depsgraph, scene, ob);
+  BKE_object_batch_cache_dirty_tag(ob);
 }
 
 void BKE_object_eval_ptcache_reset(Depsgraph *depsgraph, Scene *scene, Object *object)
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index e561d0b653c..8d1074d912f 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -1496,7 +1496,7 @@ void DepsgraphNodeBuilder::build_object_data_geometry(Object *object, bool is_ob
   add_operation_node(
       &object->id,
       NodeType::BATCH_CACHE,
-      OperationCode::BATCH_UPDATE_SELECT,
+      OperationCode::GEOMETRY_SELECT_UPDATE,
       [object_cow](::Depsgraph *depsgraph) { BKE_object_select_update(depsgraph, object_cow); });
 }
 
@@ -1517,37 +1517,33 @@ void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata, bool
   if (key) {
     build_shapekeys(key);
   }
-
-  /* Geometry evaluation. */
-  /* Entry operation, takes care of initialization, and some other
-   * relations which needs to be run prior to actual geometry evaluation. */
-  op_node = add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_INIT);
-  op_node->set_as_entry();
-
-  add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_DEFORM);
-
+  /* Nodes for result of obdata's evaluation, and geometry
+   * evaluation on object. */
   const ID_Type id_type = GS(obdata->name);
   switch (id_type) {
     case ID_ME: {
-      add_operation_node(obdata,
-                         NodeType::GEOMETRY,
-                         OperationCode::GEOMETRY_EVAL,
-                         [obdata_cow](::Depsgraph *depsgraph) {
-                           BKE_mesh_eval_geometry(depsgraph, (Mesh *)obdata_cow);
-                         });
+      op_node = add_operation_node(obdata,
+                                   NodeType::GEOMETRY,
+                                   OperationCode::GEOMETRY_EVAL,
+                                   [obdata_cow](::Depsgraph *depsgraph) {
+                                     BKE_mesh_eval_geometry(depsgraph, (Mesh *)obdata_cow);
+                                   });
+      op_node->set_as_entry();
       break;
     }
     case ID_MB: {
-      add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
+      op_node = add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
+      op_node->set_as_entry();
       break;
     }
     case ID_CU: {
-      add_operation_node(obdata,
-                         NodeType::GEOMETRY,
-                         OperationCode::GEOMETRY_EVAL,
-                         [obdata_cow](::Depsgraph *depsgraph) {
-                           BKE_curve_eval_geometry(depsgraph, (Curve *)obdata_cow);
-                         });
+      op_node = add_operation_node(obdata,
+                                   NodeType::GEOMETRY,
+                                   OperationCode::GEOMETRY_EVAL,
+                                   [obdata_cow](::Depsgraph *depsgraph) {
+                                     BKE_curve_eval_geometry(depsgraph, (Curve *)obdata_cow);
+                                   });
+      op_node->set_as_entry();
       /* Make sure objects used for bevel.taper are in the graph.
        * NOTE: This objects might be not linked to the scene. */
       Curve *cu = (Curve *)obdata;
@@ -1563,41 +1559,47 @@ void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata, bool
       break;
     }
     case ID_LT: {
-      add_operation_node(obdata,
-                         NodeType::GEOMETRY,
-                         OperationCode::GEOMETRY_EVAL,
-                         [obdata_cow](::Depsgraph *depsgraph) {
-                           BKE_lattice_eval_geometry(depsgraph, (Lattice *)obdata_cow);
-                         });
+      op_node = add_operation_node(obdata,
+                                   NodeType::GEOMETRY,
+                                   OperationCode::GEOMETRY_EVAL,
+                                   [obdata_cow](::Depsgraph *depsgraph) {
+                                     BKE_lattice_eval_geometry(depsgraph, (Lattice *)obdata_cow);
+                                   });
+      op_node->set_as_entry();
       break;
     }
 
     case ID_GD: {
       /* GPencil evaluation operations. */
-      add_operation_node(obdata,
-                         NodeType::GEOMETRY,
-                         OperationCode::GEOMETRY_EVAL,
-                         [obdata_cow](::Depsgraph *depsgraph) {
-                           BKE_gpencil_frame_active_set(depsgraph, (bGPdata *)obdata_cow);
-                         });
+      op_node = add_operation_node(obdata,
+                                   NodeType::GEOMETRY,
+                                   OperationCode::GEOMETRY_EVAL,
+                                   [obdata_cow](::Depsgraph *depsgraph) {
+                                     BKE_gpencil_frame_active_set(depsgraph,
+                                                                  (bGPdata *)obdata_cow);
+                                   });
+      op_node->set_as_entry();
       break;
     }
     case ID_HA: {
-      add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
+      op_node = add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
+      op_node->set_as_entry();
       break;
     }
     case ID_PT: {
-      add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
+      op_node = add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
+      op_node->set_as_entry();
       break;
     }
     case ID_VO: {
       /* Volume frame update. */
-      add_operation_node(obdata,
-                         NodeType::GEOMETRY,
-                         OperationCode::GEOMETRY_EVAL,
-                         [obdata_cow](::Depsgraph *depsgraph) {
-                           BKE_volume_eval_geometry(depsgraph, (Volume *)obdata_cow);
-                         });
+      op_node = add_operation_node(obdata,
+                                   NodeType::GEOMETRY,
+                                   OperationCode::GEOMETRY_EVAL,
+                                   [obdata_cow](::Depsgraph *depsgraph) {
+                                     BKE_volume_eval_geometry(depsgraph, (Volume *)obdata_cow);
+                                   });
+      op_node->set_as_entry();
       break;
     }
     default:
@@ -1611,22 +1613,10 @@ void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata, bool
   /* Batch cache. */
   add_operation_node(obdata,
                      NodeType::BATCH_CACHE,
-                     OperationCode::BATCH_UPDATE_SELECT,
+                     OperationCode::GEOMETRY_SELECT_UPDATE,
                      [obdata_cow](::Depsgraph *depsgraph) {
                        BKE_object_data_select_update(depsgraph, obdata_cow);
                      });
-  add_operation_node(obdata,
-                     NodeType::BATCH_CACHE,
-                     OperationCode::BATCH_UPDATE_DEFORM,
-                     [obdata_cow](::Depsgraph *depsgraph) {
-                       BKE_object_data_eval_batch_cache_deform_tag(depsgraph, obdata_cow);
-                     });
-  add_operation_node(obdata,
-                     NodeType::BATCH_CACHE,
-                     OperationCode::BATCH_UPDATE_ALL,
-                     [obdata_cow](::Depsgraph *depsgraph) {
-                       BKE_object_data_eval_batch_cache_dirty_tag(depsgraph, ob

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list