Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2019-04-29 18:52:08 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-04-29 19:51:07 +0300
commitc7767f1bcfd28ae3352b58a52eae2d63b4a22329 (patch)
tree573b08cec21ae0ef1014e0babf8b2112a5882213 /source/blender/draw/intern/draw_cache_impl_mesh.c
parent88e20c663c61fe02cf4af96e1079e6d3ac86f162 (diff)
DRW: Improve edit mode selection time when using auto-smooth
Unfortunately it does not concern paint mode. Related to T63946
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_mesh.c')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index a72c5ba7d5e..827937a6068 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -2172,8 +2172,12 @@ void DRW_mesh_batch_cache_dirty_tag(Mesh *me, int mode)
GPU_BATCH_DISCARD_SAFE(cache->batch.edit_edges);
GPU_BATCH_DISCARD_SAFE(cache->batch.edit_facedots);
GPU_BATCH_DISCARD_SAFE(cache->batch.edit_mesh_analysis);
- /* Paint mode selection */
- /* TODO only do that in paint mode. */
+ /* Because visible UVs depends on edit mode selection, discard everything. */
+ mesh_batch_cache_discard_uvedit(cache);
+ break;
+ case BKE_MESH_BATCH_DIRTY_SELECT_PAINT:
+ /* Paint mode selection flag is packed inside the nor attrib.
+ * Note that it can be slow if auto smooth is enabled. (see T63946) */
GPU_VERTBUF_DISCARD_SAFE(cache->ordered.loop_pos_nor);
GPU_BATCH_DISCARD_SAFE(cache->batch.surface);
GPU_BATCH_DISCARD_SAFE(cache->batch.wire_loops);
@@ -2182,8 +2186,6 @@ void DRW_mesh_batch_cache_dirty_tag(Mesh *me, int mode)
GPU_BATCH_DISCARD_SAFE(cache->surf_per_mat[i]);
}
}
- /* Because visible UVs depends on edit mode selection, discard everything. */
- mesh_batch_cache_discard_uvedit(cache);
break;
case BKE_MESH_BATCH_DIRTY_ALL:
cache->is_dirty = true;