diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-31 16:24:38 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-31 16:24:38 +0300 |
commit | 458dd4100f08b365ff3e5213b79b1300d19f9d65 (patch) | |
tree | 111a8772eaca658d24a42da530d90f85f4c84fe6 /source/blender/blenkernel/intern/mesh_evaluate.c | |
parent | 483b981d635f02da4a4529c586a337705a03cf62 (diff) | |
parent | f309becf2d5687586d9420a4835d8e49a22654d4 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_evaluate.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_evaluate.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c index 00d1b29caf8..e33f4a7feab 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.c +++ b/source/blender/blenkernel/intern/mesh_evaluate.c @@ -253,16 +253,6 @@ static void mesh_calc_normals_poly_prepare_cb( } } -static void mesh_calc_normals_poly_accum_cb( - void *__restrict userdata, - const int lidx, - const ParallelRangeTLS *__restrict UNUSED(tls)) -{ - MeshCalcNormalsData *data = userdata; - - add_v3_v3(data->vnors[data->mloop[lidx].v], data->lnors_weighted[lidx]); -} - static void mesh_calc_normals_poly_finalize_cb( void *__restrict userdata, const int vidx, @@ -327,7 +317,11 @@ void BKE_mesh_calc_normals_poly( BLI_task_parallel_range(0, numPolys, &data, mesh_calc_normals_poly_prepare_cb, &settings); /* Actually accumulate weighted loop normals into vertex ones. */ - BLI_task_parallel_range(0, numLoops, &data, mesh_calc_normals_poly_accum_cb, &settings); + /* Unfortunately, not possible to thread that (not in a reasonable, totally lock- and barrier-free fashion), + * since several loops will point to the same vertex... */ + for (int lidx = 0; lidx < numLoops; lidx++) { + add_v3_v3(vnors[mloop[lidx].v], data.lnors_weighted[lidx]); + } /* Normalize and validate computed vertex normals. */ BLI_task_parallel_range(0, numVerts, &data, mesh_calc_normals_poly_finalize_cb, &settings); |