diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-16 14:41:37 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-16 14:45:24 +0300 |
commit | f4755ef695f6b9976d5b3d73988beaeb10909593 (patch) | |
tree | 1d25f6c59f11daea06986f40fce2a370057b0f30 /source | |
parent | 4cd191aa295fffa2649fb70a5bb77c721be9949c (diff) |
Fix edit-mesh select crash when using face-dots
The GPUVertBuf was freed but not the GPUBatch.
Old bug exposed by new code from 8a6414ed46f66.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_mesh.c | 4 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index eb626e2f954..9fb9f9713d1 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -2214,9 +2214,11 @@ void DRW_mesh_batch_cache_dirty_tag(Mesh *me, int mode) GPU_BATCH_DISCARD_SAFE(cache->batch.edit_vertices); GPU_BATCH_DISCARD_SAFE(cache->batch.edit_edges); GPU_BATCH_DISCARD_SAFE(cache->batch.edit_facedots); + GPU_BATCH_DISCARD_SAFE(cache->batch.edit_selection_facedots); GPU_BATCH_DISCARD_SAFE(cache->batch.edit_mesh_analysis); cache->batch_ready &= ~(MBC_EDIT_TRIANGLES | MBC_EDIT_VERTICES | MBC_EDIT_EDGES | - MBC_EDIT_FACEDOTS | MBC_EDIT_MESH_ANALYSIS); + MBC_EDIT_FACEDOTS | MBC_EDIT_SELECTION_FACEDOTS | + MBC_EDIT_MESH_ANALYSIS); /* Because visible UVs depends on edit mode selection, discard everything. */ mesh_batch_cache_discard_uvedit(cache); break; diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index ca283e3a83a..e68f3e4b9e1 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -2801,7 +2801,7 @@ void DRW_draw_select_id_object(Scene *scene, if (select_mode & SCE_SELECT_VERTEX) { geom_verts = DRW_mesh_batch_cache_get_verts_with_select_id(me); } - if (draw_facedot) { + if (use_faceselect && draw_facedot) { geom_facedots = DRW_mesh_batch_cache_get_facedots_with_select_id(me); } DRW_mesh_batch_cache_create_requested(ob, me, NULL, false, true); |