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:
authorBastien Montagne <montagne29@wanadoo.fr>2014-01-21 19:32:36 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-01-21 19:32:47 +0400
commitc691551249f3fe3982c43e4c75be40a19503dd26 (patch)
tree3332a4f50ff5e6df3884a44334b07e578d619840 /source/blender/blenkernel/BKE_mesh_mapping.h
parentcda894fcfd6a19f48eeb745af49800b5165f936c (diff)
Optimize tessellation code (min 20% better, up to 300% with some CD layers to tessellate).
The main idea is to store (during tessellation) or recreate (during tessdata update) a tessfaceverts-to-loops mapping, and then update all tessdata in one pass, instead of calling `BKE_mesh_loops_to_mface_corners` repeatedly for all tfaces! Differential Revision: https://developer.blender.org/D226 Reviewed by Campbell, thanks a lot!
Diffstat (limited to 'source/blender/blenkernel/BKE_mesh_mapping.h')
-rw-r--r--source/blender/blenkernel/BKE_mesh_mapping.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_mesh_mapping.h b/source/blender/blenkernel/BKE_mesh_mapping.h
index ee9e63e6975..f3f6b556a07 100644
--- a/source/blender/blenkernel/BKE_mesh_mapping.h
+++ b/source/blender/blenkernel/BKE_mesh_mapping.h
@@ -129,4 +129,13 @@ int *BKE_mesh_calc_smoothgroups(
const struct MLoop *mloop, const int totloop,
int *r_totgroup, const bool use_bitflags);
+/* No good (portable) way to have exported inlined functions... */
+#define BKE_MESH_TESSFACE_VINDEX_ORDER(_mf, _v) ( \
+ (CHECK_TYPE_INLINE(_mf, MFace *), CHECK_TYPE_INLINE(_v, unsigned int)), \
+ ((_mf->v1 == _v) ? 0 : \
+ (_mf->v2 == _v) ? 1 : \
+ (_mf->v3 == _v) ? 2 : \
+ (_mf->v4 && _mf->v4 == _v) ? 3 : -1) \
+ )
+
#endif /* __BKE_MESH_MAPPING_H__ */