diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-06-30 17:13:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-07-01 07:56:39 +0300 |
commit | d885b1141c7cdf8c75ec7e1983546c2dd9da1004 (patch) | |
tree | ccc6e82fba087db3ae26595ae057993b1e761d95 /source/blender/draw/intern/draw_cache_extract.h | |
parent | 36d6aa428f4848cfb153b34bdc4921ee9cabb227 (diff) |
DRW: optimize mesh data extraction
Change extraction callbacks to take index ranges instead of calling them
for each mesh element (poly, loop, vert & edge).
This gives a minor overall performance gain in my tests, ~5% on average.
Details:
- Use typed parameter structs and macros for looping over elements.
Without this, changes to these callbacks is time consuming as changes
need to be made in many places.
- Avoid iterating over polygon-loops when iterating over polygons
is sufficient.
- Simplify logic to access adjacent loops for faster line extraction.
- Rename 'loop' iterators to 'poly' (as they take polygon ranges)
the iterator callbacks can operator on either polygon or loop data.
- Use term 'last' for the last index (inclusive),
use 'end' when this value (not inclusive).
Diffstat (limited to 'source/blender/draw/intern/draw_cache_extract.h')
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract.h b/source/blender/draw/intern/draw_cache_extract.h index 0b1f625dc2c..302f9a0d3a8 100644 --- a/source/blender/draw/intern/draw_cache_extract.h +++ b/source/blender/draw/intern/draw_cache_extract.h @@ -63,7 +63,7 @@ typedef struct DRW_MeshCDMask { typedef enum eMRIterType { MR_ITER_LOOPTRI = 1 << 0, - MR_ITER_LOOP = 1 << 1, + MR_ITER_POLY = 1 << 1, MR_ITER_LEDGE = 1 << 2, MR_ITER_LVERT = 1 << 3, } eMRIterType; |