From 4ba06ad0a8cdec66d9a9cb06f982736d46c40f4c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 14 Jul 2021 13:22:58 +1000 Subject: Edit Mesh: multi-thread auto-smooth & custom normal calculations Supported multi-threading for bm_mesh_loops_calc_normals. This is done by operating on vertex-loops instead of face-loops. Single threaded operation still loops over faces since iterating over vertices adds some overhead in the case of custom-normals as the order used for accessing loops must be the same as iterating of a faces loops. From isolated timing tests of bm_mesh_loops_calc_normals on high poly models, this gives between 3.5x to 10x speedup, with larger gains for meshes with custom-normals. NOTE: this is part one of two patches for multi-threaded auto-smooth, tagging edges as sharp is still single threaded. Reviewed By: mont29 Ref D11928 --- source/blender/blenkernel/BKE_mesh.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/blenkernel/BKE_mesh.h') diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 7846619577e..e3be9cd8ef8 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -399,6 +399,12 @@ void BKE_lnor_spacearr_init(MLoopNorSpaceArray *lnors_spacearr, const char data_type); void BKE_lnor_spacearr_clear(MLoopNorSpaceArray *lnors_spacearr); void BKE_lnor_spacearr_free(MLoopNorSpaceArray *lnors_spacearr); + +void BKE_lnor_spacearr_tls_init(MLoopNorSpaceArray *lnors_spacearr, + MLoopNorSpaceArray *lnors_spacearr_tls); +void BKE_lnor_spacearr_tls_join(MLoopNorSpaceArray *lnors_spacearr, + MLoopNorSpaceArray *lnors_spacearr_tls); + MLoopNorSpace *BKE_lnor_space_create(MLoopNorSpaceArray *lnors_spacearr); void BKE_lnor_space_define(MLoopNorSpace *lnor_space, const float lnor[3], -- cgit v1.2.3