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/draw/intern/draw_subdivision.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/draw/intern/draw_subdivision.h')
-rw-r--r-- | source/blender/draw/intern/draw_subdivision.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/draw/intern/draw_subdivision.h b/source/blender/draw/intern/draw_subdivision.h index 8920a2dcd51..2d9f4713feb 100644 --- a/source/blender/draw/intern/draw_subdivision.h +++ b/source/blender/draw/intern/draw_subdivision.h @@ -185,8 +185,7 @@ void draw_subdiv_cache_free(DRWSubdivCache *cache); /** \} */ -void DRW_create_subdivision(const struct Scene *scene, - struct Object *ob, +void DRW_create_subdivision(struct Object *ob, struct Mesh *mesh, struct MeshBatchCache *batch_cache, struct MeshBufferCache *mbc, |