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>2016-01-16 17:59:37 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-01-16 17:59:37 +0300
commit31d907fa0ad1afa8c8a1829e16d3af394ab9e301 (patch)
treef889d37f917b5f4daf121d7595daafccced8e514 /source/blender/modifiers/intern/MOD_weightvgproximity.c
parent724809655c891b13bba49b60cbb2ddab3d54f18a (diff)
Cleanup: BLI_task - API changes.
Based on usages so far: - Split callback worker func in two, 'basic' and 'extended' versions. The former goes back to the simplest verion, while the later keeps the 'userdata_chunk', and gets the thread_id too. - Add use_threading to simple BLI_task_parallel_range(), turns out we need this pretty much systematically, and allows to get rid of most usages of BLI_task_parallel_range_ex(). - Now BLI_task_parallel_range() expects 'basic' version of callback, while BLI_task_parallel_range_ex() expectes 'extended' version of the callback. All in all, this should make common usage of BLI_task_parallel_range simpler (less verbose), and add access to advanced callback to thread id, which is mandatory in some (future) cases.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_weightvgproximity.c')
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgproximity.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c
index be86dfe4a92..f126e499fc2 100644
--- a/source/blender/modifiers/intern/MOD_weightvgproximity.c
+++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c
@@ -89,7 +89,7 @@ typedef struct Vert2GeomDataChunk {
/**
* Callback used by BLI_task 'for loop' helper.
*/
-static void vert2geom_task_cb(void *userdata, void *userdata_chunk, int iter)
+static void vert2geom_task_cb_ex(void *userdata, void *userdata_chunk, const int iter, const int UNUSED(thread_id))
{
Vert2GeomData *data = userdata;
Vert2GeomDataChunk *data_chunk = userdata_chunk;
@@ -177,7 +177,8 @@ static void get_vert2geom_distance(int numVerts, float (*v_cos)[3],
data.dist[2] = dist_f;
BLI_task_parallel_range_ex(
- 0, numVerts, &data, &data_chunk, sizeof(data_chunk), vert2geom_task_cb, numVerts > 10000, false);
+ 0, numVerts, &data, &data_chunk, sizeof(data_chunk), vert2geom_task_cb_ex,
+ numVerts > 10000, false);
if (dist_v)
free_bvhtree_from_mesh(&treeData_v);