diff options
author | Hans Goudey <h.goudey@me.com> | 2022-02-22 20:47:05 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-02-22 20:47:05 +0300 |
commit | c7a9f76149d85dfb64710722a45979f6decedbb1 (patch) | |
tree | f4d763e7a41bb9f8f2baab0e8708ac6f9c55c39b /source/blender/makesdna | |
parent | f3d97498c3a6afcffbe3c8551fec32efb246a4f1 (diff) | |
parent | 59343ee1627f4c369e237cea201015b979da1540 (diff) |
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_customdata_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 13 |
2 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index 23406033126..2f9f63cb966 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -98,6 +98,10 @@ typedef enum CustomDataType { CD_MTFACE = 5, CD_MCOL = 6, CD_ORIGINDEX = 7, + /** + * Used for derived face corner normals on mesh `ldata`, since currently they are not computed + * lazily. Derived vertex and polygon normals are stored in #Mesh_Runtime. + */ CD_NORMAL = 8, CD_FACEMAP = 9, /* exclusive face group, each face can only be part of one */ CD_PROP_FLOAT = 10, diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index c566ad93335..f40e91c1d5e 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -116,14 +116,23 @@ typedef struct Mesh_Runtime { */ char wrapper_type_finalize; + int subsurf_resolution; /** * Settings for lazily evaluating the subdivision on the CPU if needed. These are * set in the modifier when GPU subdivision can be performed. */ char subsurf_apply_render; char subsurf_use_optimal_display; - char _pad[2]; - int subsurf_resolution; + + /** + * Caches for lazily computed vertex and polygon normals. These are stored here rather than in + * #CustomData because they can be calculated on a const mesh, and adding custom data layers on a + * const mesh is not thread-safe. + */ + char vert_normals_dirty; + char poly_normals_dirty; + float (*vert_normals)[3]; + float (*poly_normals)[3]; void *_pad2; |