[Bf-blender-cvs] [f4755ef695f] master: Fix edit-mesh select crash when using face-dots
Campbell Barton
noreply at git.blender.org
Thu May 16 13:46:00 CEST 2019
Commit: f4755ef695f6b9976d5b3d73988beaeb10909593
Author: Campbell Barton
Date: Thu May 16 21:41:37 2019 +1000
Branches: master
https://developer.blender.org/rBf4755ef695f6b9976d5b3d73988beaeb10909593
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.
===================================================================
M source/blender/draw/intern/draw_cache_impl_mesh.c
M source/blender/draw/intern/draw_manager.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list