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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-01-10 14:49:51 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-01-10 14:49:51 +0300
commit561419374549201845bdd58e7329f61eef574f7f (patch)
treecc2f7e759b13ef119480bfc239ae23cd4d3062a6 /source/blender/blenkernel/intern/mesh_evaluate.c
parent518c65460e8843e425fee2161b407e1f8e9e4281 (diff)
Task scheduler: Use restrict pointer qualifier
Those pointers are never to be aliased, so let's be explicit about this and hope compiler does save some CPU ticks.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_evaluate.c')
-rw-r--r--source/blender/blenkernel/intern/mesh_evaluate.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index c1beaaaac75..b321065d84c 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -177,8 +177,10 @@ typedef struct MeshCalcNormalsData {
float (*vnors)[3];
} MeshCalcNormalsData;
-static void mesh_calc_normals_poly_cb(void *userdata, const int pidx,
- const ParallelRangeTLS *UNUSED(tls))
+static void mesh_calc_normals_poly_cb(
+ void *__restrict userdata,
+ const int pidx,
+ const ParallelRangeTLS *__restrict UNUSED(tls))
{
MeshCalcNormalsData *data = userdata;
const MPoly *mp = &data->mpolys[pidx];
@@ -186,8 +188,10 @@ 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,
- const ParallelRangeTLS *UNUSED(tls))
+static void mesh_calc_normals_poly_prepare_cb(
+ void *__restrict userdata,
+ const int pidx,
+ const ParallelRangeTLS *__restrict UNUSED(tls))
{
MeshCalcNormalsData *data = userdata;
const MPoly *mp = &data->mpolys[pidx];
@@ -249,16 +253,20 @@ 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,
- const ParallelRangeTLS *UNUSED(tls))
+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 *userdata, const int vidx,
- const ParallelRangeTLS *UNUSED(tls))
+static void mesh_calc_normals_poly_finalize_cb(
+ void *__restrict userdata,
+ const int vidx,
+ const ParallelRangeTLS *__restrict UNUSED(tls))
{
MeshCalcNormalsData *data = userdata;