From ea4309925f1d2d2a224bd1dce12269a58ade9b62 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Fri, 18 Jun 2021 15:31:14 +0200 Subject: Performance: Limit recounting during selection mode flushing. This patch ensures that selection mode flushing updates total selection counts internally. This reduces recounting when we are sure that the input total selection counts were up to date. For example for circle selection the total selection counts were correct. But during flushing the selection could have been changed and therefore the selection was always recounted. This increased the performance on selected system from 6.90 FPS to 8.25 FPS during circle selection operations. Before: {F10179981} After: {F10179982} Reviewed By: mano-wii Differential Revision: https://developer.blender.org/D11647 --- source/blender/bmesh/intern/bmesh_marking.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source/blender/bmesh/intern/bmesh_marking.h') diff --git a/source/blender/bmesh/intern/bmesh_marking.h b/source/blender/bmesh/intern/bmesh_marking.h index 04a49e24757..ff6c359138a 100644 --- a/source/blender/bmesh/intern/bmesh_marking.h +++ b/source/blender/bmesh/intern/bmesh_marking.h @@ -26,6 +26,16 @@ typedef struct BMEditSelection { char htype; } BMEditSelection; +typedef enum eBMSelectionFlushFLags { + BM_SELECT_LEN_FLUSH_RECALC_NOTHING = 0, + BM_SELECT_LEN_FLUSH_RECALC_VERT = (1 << 0), + BM_SELECT_LEN_FLUSH_RECALC_EDGE = (1 << 1), + BM_SELECT_LEN_FLUSH_RECALC_FACE = (1 << 2), + BM_SELECT_LEN_FLUSH_RECALC_ALL = (BM_SELECT_LEN_FLUSH_RECALC_VERT | + BM_SELECT_LEN_FLUSH_RECALC_EDGE | + BM_SELECT_LEN_FLUSH_RECALC_FACE), +} eBMSelectionFlushFLags; + /* geometry hiding code */ #define BM_elem_hide_set(bm, ele, hide) _bm_elem_hide_set(bm, &(ele)->head, hide) void _bm_elem_hide_set(BMesh *bm, BMHeader *head, const bool hide); @@ -72,7 +82,7 @@ void BM_mesh_select_mode_clean_ex(BMesh *bm, const short selectmode); void BM_mesh_select_mode_clean(BMesh *bm); void BM_mesh_select_mode_set(BMesh *bm, int selectmode); -void BM_mesh_select_mode_flush_ex(BMesh *bm, const short selectmode); +void BM_mesh_select_mode_flush_ex(BMesh *bm, const short selectmode, eBMSelectionFlushFLags flags); void BM_mesh_select_mode_flush(BMesh *bm); void BM_mesh_deselect_flush(BMesh *bm); -- cgit v1.2.3