[Bf-blender-cvs] [69fafceb87f] temp-vert-normals-cleanup: Merge branch 'master' into temp-vert-normals-cleanup
Hans Goudey
noreply at git.blender.org
Fri Dec 10 19:33:48 CET 2021
Commit: 69fafceb87f0fa4dee1b20deee73f6666f05aa28
Author: Hans Goudey
Date: Fri Dec 10 12:33:41 2021 -0600
Branches: temp-vert-normals-cleanup
https://developer.blender.org/rB69fafceb87f0fa4dee1b20deee73f6666f05aa28
Merge branch 'master' into temp-vert-normals-cleanup
===================================================================
===================================================================
diff --cc source/blender/makesdna/DNA_mesh_types.h
index 84ed52e9d8f,77cb553c7c7..ea2471ad30c
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@@ -81,30 -81,34 +81,38 @@@ typedef struct Mesh_Runtime
* Since modifier stack evaluation is threaded on object level we need some synchronization. */
struct Mesh *mesh_eval;
void *eval_mutex;
+
+ /* A separate mutex is needed for normal calculation, because sometimes
+ * the normals are needed while #eval_mutex is already locked. */
+ void *normals_mutex;
+
- struct EditMeshData *edit_data;
- void *batch_cache;
+ /** Needed to ensure some thread-safety during render data pre-processing. */
+ void *render_mutex;
- struct SubdivCCG *subdiv_ccg;
- int subdiv_ccg_tot_level;
- char _pad2[4];
+ /** Lazily initialized SoA data from the #edit_mesh field in #Mesh. */
+ struct EditMeshData *edit_data;
- int64_t cd_dirty_vert;
- int64_t cd_dirty_edge;
- int64_t cd_dirty_loop;
- int64_t cd_dirty_poly;
+ /**
+ * Data used to efficiently draw the mesh in the viewport, especially useful when
+ * the same mesh is used in many objects or instances. See `draw_cache_impl_mesh.c`.
+ */
+ void *batch_cache;
+ /** Cache for derived triangulation of the mesh. */
struct MLoopTri_Store looptris;
- /** `BVHCache` defined in 'BKE_bvhutil.c' */
+ /** Cache for BVH trees generated for the mesh. Defined in 'BKE_bvhutil.c' */
struct BVHCache *bvh_cache;
- /** Non-manifold boundary data for Shrinkwrap Target Project. */
+ /** Cache of non-manifold boundary data for Shrinkwrap Target Project. */
struct ShrinkwrapBoundaryData *shrinkwrap_data;
+ /** Needed in case we need to lazily initialize the mesh. */
+ CustomData_MeshMasks cd_mask_extra;
+
+ struct SubdivCCG *subdiv_ccg;
+ int subdiv_ccg_tot_level;
+
/** Set by modifier stack if only deformed from original. */
char deformed_only;
/**
@@@ -124,14 -128,15 +132,17 @@@
*/
char wrapper_type_finalize;
- char _pad[4];
++ void *_pad;
+
- /** Needed in case we need to lazily initialize the mesh. */
- CustomData_MeshMasks cd_mask_extra;
+ /**
+ * Used to mark when derived data needs to be recalculated for a certain layer.
+ * Currently only normals.
+ */
- /** Needed to ensure some thread-safety during render data pre-processing. */
- void *render_mutex;
- void *_pad3;
+ int64_t cd_dirty_vert;
+ int64_t cd_dirty_edge;
+ int64_t cd_dirty_loop;
+ int64_t cd_dirty_poly;
} Mesh_Runtime;
@@@ -237,7 -329,10 +335,10 @@@ typedef struct Mesh
* default and Face Sets can be used without affecting the color of the mesh. */
int face_sets_color_default;
- void *_pad2;
+ char _pad1[4];
+
- void *_pad2;
++ void *_pad;
+
Mesh_Runtime runtime;
} Mesh;
More information about the Bf-blender-cvs
mailing list