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-05 18:33:13 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-01-09 18:09:33 +0300
commitd2708b0f73d5f0e0a40b36da21c6a0d15405e739 (patch)
tree53d699a0a7701dbe009234633a38065e6f474cdf /source/blender/blenlib/intern/BLI_kdopbvh.c
parentf5d64b59f5152114cfa25a2b7433ed25204cb149 (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/blenlib/intern/BLI_kdopbvh.c')
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index bd16bc1a9c6..6e33f75fe69 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -798,7 +798,7 @@ typedef struct BVHDivNodesData {
int first_of_next_level;
} BVHDivNodesData;
-static void non_recursive_bvh_div_nodes_task_cb(void *userdata, const int j)
+static void non_recursive_bvh_div_nodes_task_cb(void *userdata, const int j, const ParallelRangeTLS *UNUSED(tls))
{
BVHDivNodesData *data = userdata;
@@ -929,8 +929,9 @@ static void non_recursive_bvh_div_nodes(
}
else {
/* Less hassle for debugging. */
+ ParallelRangeTLS tls = {0};
for (int i_task = i; i_task < i_stop; i_task++) {
- non_recursive_bvh_div_nodes_task_cb(&cb_data, i_task);
+ non_recursive_bvh_div_nodes_task_cb(&cb_data, i_task, &tls);
}
}
}
@@ -1276,7 +1277,7 @@ int BLI_bvhtree_overlap_thread_num(const BVHTree *tree)
return (int)MIN2(tree->tree_type, tree->nodes[tree->totleaf]->totnode);
}
-static void bvhtree_overlap_task_cb(void *userdata, const int j)
+static void bvhtree_overlap_task_cb(void *userdata, const int j, const ParallelRangeTLS *UNUSED(tls))
{
BVHOverlapData_Thread *data = &((BVHOverlapData_Thread *)userdata)[j];
BVHOverlapData_Shared *data_shared = data->shared;