diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-05 18:33:13 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-09 18:09:33 +0300 |
commit | d2708b0f73d5f0e0a40b36da21c6a0d15405e739 (patch) | |
tree | 53d699a0a7701dbe009234633a38065e6f474cdf /source/blender/blenkernel/intern/mesh_evaluate.c | |
parent | f5d64b59f5152114cfa25a2b7433ed25204cb149 (diff) |
Task scheduler: Get rid of extended version of parallel range callback
Wrap all arguments into TLS type of argument. Avoids some branching and also
makes it easier to extend things in the future.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_evaluate.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_evaluate.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c index 35757557f76..b58bea941e5 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.c +++ b/source/blender/blenkernel/intern/mesh_evaluate.c @@ -177,7 +177,8 @@ typedef struct MeshCalcNormalsData { float (*vnors)[3]; } MeshCalcNormalsData; -static void mesh_calc_normals_poly_cb(void *userdata, const int pidx) +static void mesh_calc_normals_poly_cb(void *userdata, const int pidx, + const ParallelRangeTLS *UNUSED(tls)) { MeshCalcNormalsData *data = userdata; const MPoly *mp = &data->mpolys[pidx]; @@ -185,7 +186,8 @@ static void mesh_calc_normals_poly_cb(void *userdata, const int pidx) BKE_mesh_calc_poly_normal(mp, data->mloop + mp->loopstart, data->mverts, data->pnors[pidx]); } -static void mesh_calc_normals_poly_prepare_cb(void *userdata, const int pidx) +static void mesh_calc_normals_poly_prepare_cb(void *userdata, const int pidx, + const ParallelRangeTLS *UNUSED(tls)) { MeshCalcNormalsData *data = userdata; const MPoly *mp = &data->mpolys[pidx]; @@ -247,14 +249,16 @@ static void mesh_calc_normals_poly_prepare_cb(void *userdata, const int pidx) } } -static void mesh_calc_normals_poly_accum_cb(void *userdata, const int lidx) +static void mesh_calc_normals_poly_accum_cb(void *userdata, const int lidx, + const ParallelRangeTLS *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 *userdata, const int vidx) +static void mesh_calc_normals_poly_finalize_cb(void *userdata, const int vidx, + const ParallelRangeTLS *UNUSED(tls)) { MeshCalcNormalsData *data = userdata; |