diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-06-13 16:21:05 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-06-14 15:54:25 +0300 |
commit | ca9d65cc97ba8e872a0ef456e51dacadd06e237e (patch) | |
tree | 146e6457b8bc16563cb528ce2d43c5c93506e0db /source/blender/makesdna/DNA_modifier_types.h | |
parent | 4e96d71ddba8a5879337833ff7d63de12cf719a8 (diff) |
Fix T98813: crash with GPU subdiv in edit mode and instanced geometry
Instancing with geometry nodes uses just the evaluated Mesh, and ignores the
Object that it came from. That meant that it would try to look up the subsurf
modifier on the instancer object which does not have the subsurf modifier.
Instead of storing a session UUID and looking up the modifier data, store a
point to the subsurf modifier runtime data. Unlike the modifier data, this
runtime data is preserved across depsgraph CoW. It must be for the subdiv
descriptor contained in it to stay valid along with the draw cache.
As a bonus, this moves various Mesh_Runtime variables into the subsurf runtime
data, reducing memory usage for meshes not using subdivision surfaces.
Also fixes T98693, issues with subdivision level >= 8 due to integer overflow.
Differential Revision: https://developer.blender.org/D15184
Diffstat (limited to 'source/blender/makesdna/DNA_modifier_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_modifier_types.h | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 6e3ce7e98a8..f148116eba8 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -178,13 +178,6 @@ typedef enum { SUBSURF_BOUNDARY_SMOOTH_PRESERVE_CORNERS = 1, } eSubsurfBoundarySmooth; -typedef struct SubsurfRuntimeData { - /* Cached subdivision surface descriptor, with topology and settings. */ - struct Subdiv *subdiv; - char set_by_draw_code; - char _pad[7]; -} SubsurfRuntimeData; - typedef struct SubsurfModifierData { ModifierData modifier; |