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:
authorJacques Lucke <jacques@blender.org>2021-06-16 17:13:53 +0300
committerJacques Lucke <jacques@blender.org>2021-06-16 17:14:02 +0300
commit45d59e0df5fe749d428ebf662b61844561df64c4 (patch)
treea70616dc409c67006956ac149bd43efa22c61bc4 /source/blender/nodes
parent0cebe554d13bf1ea4c81fd4addee30dd4ea4d2f1 (diff)
BLI: add threading namespace
This namespace groups threading related functions/classes. This avoids adding more threading related stuff to the blender namespace. Also it makes naming a bit easier, e.g. the c++ version of BLI_task_isolate could become blender::threading::isolate_task or something similar. Differential Revision: https://developer.blender.org/D11624
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc4
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc2
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_curve_map.cc6
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_map_range.cc18
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_math.cc6
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc6
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc2
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc12
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_sample_texture.cc2
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc14
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_vector_rotate.cc6
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_curve_reverse.cc2
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc8
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_mesh_to_curve.cc6
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_point_instance.cc4
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_select_by_material.cc2
16 files changed, 50 insertions, 50 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc b/source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc
index d1b71d6f2ba..9b6824fdb5c 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc
@@ -78,7 +78,7 @@ static void align_rotations_auto_pivot(const VArray<float3> &vectors,
const float3 local_main_axis,
const MutableSpan<float3> rotations)
{
- parallel_for(IndexRange(vectors.size()), 128, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(vectors.size()), 128, [&](IndexRange range) {
for (const int i : range) {
const float3 vector = vectors[i];
if (is_zero_v3(vector)) {
@@ -129,7 +129,7 @@ static void align_rotations_fixed_pivot(const VArray<float3> &vectors,
return;
}
- parallel_for(IndexRange(vectors.size()), 128, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(vectors.size()), 128, [&](IndexRange range) {
for (const int i : range) {
const float3 vector = vectors[i];
if (is_zero_v3(vector)) {
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc
index 5293dd8c876..c5740395dfb 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc
@@ -95,7 +95,7 @@ static void execute_on_component(const GeoNodeExecParams &params, GeometryCompon
MutableSpan<ColorGeometry4f> results = attribute_result.as_span();
ColorBand *color_ramp = &node_storage->color_ramp;
- parallel_for(IndexRange(attribute_in.size()), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(attribute_in.size()), 512, [&](IndexRange range) {
for (const int i : range) {
BKE_colorband_evaluate(color_ramp, attribute_in[i], results[i]);
}
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_curve_map.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_curve_map.cc
index 599c9e58e52..06a4327a6c5 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_curve_map.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_curve_map.cc
@@ -144,7 +144,7 @@ static void execute_on_component(const GeoNodeExecParams &params, GeometryCompon
GVArray_Typed<float> attribute_in = component.attribute_get_for_read<float>(
input_name, result_domain, float(0.0f));
MutableSpan<float> results = attribute_result.as_span<float>();
- parallel_for(IndexRange(attribute_in.size()), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(attribute_in.size()), 512, [&](IndexRange range) {
for (const int i : range) {
results[i] = BKE_curvemapping_evaluateF(cumap, 3, attribute_in[i]);
}
@@ -156,7 +156,7 @@ static void execute_on_component(const GeoNodeExecParams &params, GeometryCompon
GVArray_Typed<float3> attribute_in = component.attribute_get_for_read<float3>(
input_name, result_domain, float3(0.0f));
MutableSpan<float3> results = attribute_result.as_span<float3>();
- parallel_for(IndexRange(attribute_in.size()), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(attribute_in.size()), 512, [&](IndexRange range) {
for (const int i : range) {
BKE_curvemapping_evaluate3F(cumap, results[i], attribute_in[i]);
}
@@ -169,7 +169,7 @@ static void execute_on_component(const GeoNodeExecParams &params, GeometryCompon
component.attribute_get_for_read<ColorGeometry4f>(
input_name, result_domain, ColorGeometry4f(0.0f, 0.0f, 0.0f, 1.0f));
MutableSpan<ColorGeometry4f> results = attribute_result.as_span<ColorGeometry4f>();
- parallel_for(IndexRange(attribute_in.size()), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(attribute_in.size()), 512, [&](IndexRange range) {
for (const int i : range) {
BKE_curvemapping_evaluateRGBF(cumap, results[i], attribute_in[i]);
}
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_map_range.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_map_range.cc
index 40fe675bd6c..00f38fb0c6b 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_map_range.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_map_range.cc
@@ -209,7 +209,7 @@ static void map_range_float(const VArray<float> &attribute_input,
switch (interpolation_type) {
case NODE_MAP_RANGE_LINEAR: {
- parallel_for(span.index_range(), 2048, [&](IndexRange range) {
+ threading::parallel_for(span.index_range(), 2048, [&](IndexRange range) {
for (const int i : range) {
results[i] = map_linear(span[i], min_from, max_from, min_to, max_to);
}
@@ -218,7 +218,7 @@ static void map_range_float(const VArray<float> &attribute_input,
}
case NODE_MAP_RANGE_STEPPED: {
const float steps = params.get_input<float>("Steps");
- parallel_for(span.index_range(), 1024, [&](IndexRange range) {
+ threading::parallel_for(span.index_range(), 1024, [&](IndexRange range) {
for (const int i : range) {
results[i] = map_stepped(span[i], min_from, max_from, min_to, max_to, steps);
}
@@ -226,7 +226,7 @@ static void map_range_float(const VArray<float> &attribute_input,
break;
}
case NODE_MAP_RANGE_SMOOTHSTEP: {
- parallel_for(span.index_range(), 1024, [&](IndexRange range) {
+ threading::parallel_for(span.index_range(), 1024, [&](IndexRange range) {
for (const int i : range) {
results[i] = map_smoothstep(span[i], min_from, max_from, min_to, max_to);
}
@@ -234,7 +234,7 @@ static void map_range_float(const VArray<float> &attribute_input,
break;
}
case NODE_MAP_RANGE_SMOOTHERSTEP: {
- parallel_for(span.index_range(), 1024, [&](IndexRange range) {
+ threading::parallel_for(span.index_range(), 1024, [&](IndexRange range) {
for (const int i : range) {
results[i] = map_smootherstep(span[i], min_from, max_from, min_to, max_to);
}
@@ -249,7 +249,7 @@ static void map_range_float(const VArray<float> &attribute_input,
const float clamp_min = min_to < max_to ? min_to : max_to;
const float clamp_max = min_to < max_to ? max_to : min_to;
- parallel_for(results.index_range(), 2048, [&](IndexRange range) {
+ threading::parallel_for(results.index_range(), 2048, [&](IndexRange range) {
for (const int i : range) {
results[i] = std::clamp(results[i], clamp_min, clamp_max);
}
@@ -273,7 +273,7 @@ static void map_range_float3(const VArray<float3> &attribute_input,
switch (interpolation_type) {
case NODE_MAP_RANGE_LINEAR: {
- parallel_for(span.index_range(), 1024, [&](IndexRange range) {
+ threading::parallel_for(span.index_range(), 1024, [&](IndexRange range) {
for (const int i : range) {
results[i].x = map_linear(span[i].x, min_from.x, max_from.x, min_to.x, max_to.x);
results[i].y = map_linear(span[i].y, min_from.y, max_from.y, min_to.y, max_to.y);
@@ -284,7 +284,7 @@ static void map_range_float3(const VArray<float3> &attribute_input,
}
case NODE_MAP_RANGE_STEPPED: {
const float3 steps = params.get_input<float3>("Steps_001");
- parallel_for(span.index_range(), 1024, [&](IndexRange range) {
+ threading::parallel_for(span.index_range(), 1024, [&](IndexRange range) {
for (const int i : range) {
results[i].x = map_stepped(
span[i].x, min_from.x, max_from.x, min_to.x, max_to.x, steps.x);
@@ -297,7 +297,7 @@ static void map_range_float3(const VArray<float3> &attribute_input,
break;
}
case NODE_MAP_RANGE_SMOOTHSTEP: {
- parallel_for(span.index_range(), 1024, [&](IndexRange range) {
+ threading::parallel_for(span.index_range(), 1024, [&](IndexRange range) {
for (const int i : range) {
results[i].x = map_smoothstep(span[i].x, min_from.x, max_from.x, min_to.x, max_to.x);
results[i].y = map_smoothstep(span[i].y, min_from.y, max_from.y, min_to.y, max_to.y);
@@ -307,7 +307,7 @@ static void map_range_float3(const VArray<float3> &attribute_input,
break;
}
case NODE_MAP_RANGE_SMOOTHERSTEP: {
- parallel_for(span.index_range(), 1024, [&](IndexRange range) {
+ threading::parallel_for(span.index_range(), 1024, [&](IndexRange range) {
for (const int i : range) {
results[i].x = map_smootherstep(span[i].x, min_from.x, max_from.x, min_to.x, max_to.x);
results[i].y = map_smootherstep(span[i].y, min_from.y, max_from.y, min_to.y, max_to.y);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_math.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_math.cc
index ce0ca31cc2b..9309863f4e9 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_math.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_math.cc
@@ -159,7 +159,7 @@ static void do_math_operation(const VArray<float> &span_a,
{
bool success = try_dispatch_float_math_fl_fl_fl_to_fl(
operation, [&](auto math_function, const FloatMathOperationInfo &UNUSED(info)) {
- parallel_for(IndexRange(span_result.size()), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(span_result.size()), 512, [&](IndexRange range) {
for (const int i : range) {
span_result[i] = math_function(span_a[i], span_b[i], span_c[i]);
}
@@ -176,7 +176,7 @@ static void do_math_operation(const VArray<float> &span_a,
{
bool success = try_dispatch_float_math_fl_fl_to_fl(
operation, [&](auto math_function, const FloatMathOperationInfo &UNUSED(info)) {
- parallel_for(IndexRange(span_result.size()), 1024, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(span_result.size()), 1024, [&](IndexRange range) {
for (const int i : range) {
span_result[i] = math_function(span_a[i], span_b[i]);
}
@@ -192,7 +192,7 @@ static void do_math_operation(const VArray<float> &span_input,
{
bool success = try_dispatch_float_math_fl_to_fl(
operation, [&](auto math_function, const FloatMathOperationInfo &UNUSED(info)) {
- parallel_for(IndexRange(span_result.size()), 1024, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(span_result.size()), 1024, [&](IndexRange range) {
for (const int i : range) {
span_result[i] = math_function(span_input[i]);
}
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
index a6bd6c0ee32..931b7758a57 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
@@ -88,7 +88,7 @@ static void do_mix_operation_float(const int blend_mode,
VMutableArray<float> &results)
{
const int size = results.size();
- parallel_for(IndexRange(size), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(size), 512, [&](IndexRange range) {
for (const int i : range) {
const float factor = factors[i];
float3 a{inputs_a[i]};
@@ -107,7 +107,7 @@ static void do_mix_operation_float3(const int blend_mode,
VMutableArray<float3> &results)
{
const int size = results.size();
- parallel_for(IndexRange(size), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(size), 512, [&](IndexRange range) {
for (const int i : range) {
const float factor = factors[i];
float3 a = inputs_a[i];
@@ -125,7 +125,7 @@ static void do_mix_operation_color4f(const int blend_mode,
VMutableArray<ColorGeometry4f> &results)
{
const int size = results.size();
- parallel_for(IndexRange(size), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(size), 512, [&](IndexRange range) {
for (const int i : range) {
const float factor = factors[i];
ColorGeometry4f a = inputs_a[i];
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc
index 9c22b7fa87f..b7863d38fc2 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_proximity.cc
@@ -71,7 +71,7 @@ static void proximity_calc(MutableSpan<float> distance_span,
const bool store_locations)
{
IndexRange range = positions.index_range();
- parallel_for(range, 512, [&](IndexRange range) {
+ threading::parallel_for(range, 512, [&](IndexRange range) {
BVHTreeNearest nearest_from_mesh;
BVHTreeNearest nearest_from_pointcloud;
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc
index 286411b7d28..eeb77abd624 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc
@@ -126,7 +126,7 @@ static void randomize_attribute(MutableSpan<T> span,
/* The operations could be templated too, but it doesn't make the code much shorter. */
switch (operation) {
case GEO_NODE_ATTRIBUTE_RANDOMIZE_REPLACE_CREATE:
- parallel_for(span.index_range(), 512, [&](IndexRange range) {
+ threading::parallel_for(span.index_range(), 512, [&](IndexRange range) {
for (const int i : range) {
const T random_value = random_value_in_range<T>(ids[i], seed, min, max);
span[i] = random_value;
@@ -134,7 +134,7 @@ static void randomize_attribute(MutableSpan<T> span,
});
break;
case GEO_NODE_ATTRIBUTE_RANDOMIZE_ADD:
- parallel_for(span.index_range(), 512, [&](IndexRange range) {
+ threading::parallel_for(span.index_range(), 512, [&](IndexRange range) {
for (const int i : range) {
const T random_value = random_value_in_range<T>(ids[i], seed, min, max);
span[i] = span[i] + random_value;
@@ -142,7 +142,7 @@ static void randomize_attribute(MutableSpan<T> span,
});
break;
case GEO_NODE_ATTRIBUTE_RANDOMIZE_SUBTRACT:
- parallel_for(span.index_range(), 512, [&](IndexRange range) {
+ threading::parallel_for(span.index_range(), 512, [&](IndexRange range) {
for (const int i : range) {
const T random_value = random_value_in_range<T>(ids[i], seed, min, max);
span[i] = span[i] - random_value;
@@ -150,7 +150,7 @@ static void randomize_attribute(MutableSpan<T> span,
});
break;
case GEO_NODE_ATTRIBUTE_RANDOMIZE_MULTIPLY:
- parallel_for(span.index_range(), 512, [&](IndexRange range) {
+ threading::parallel_for(span.index_range(), 512, [&](IndexRange range) {
for (const int i : range) {
const T random_value = random_value_in_range<T>(ids[i], seed, min, max);
span[i] = span[i] * random_value;
@@ -170,7 +170,7 @@ static void randomize_attribute_bool(MutableSpan<bool> span,
{
BLI_assert(operation == GEO_NODE_ATTRIBUTE_RANDOMIZE_REPLACE_CREATE);
UNUSED_VARS_NDEBUG(operation);
- parallel_for(span.index_range(), 512, [&](IndexRange range) {
+ threading::parallel_for(span.index_range(), 512, [&](IndexRange range) {
for (const int i : range) {
const bool random_value = BLI_hash_int_2d_to_float(ids[i], seed) > 0.5f;
span[i] = random_value;
@@ -190,7 +190,7 @@ Array<uint32_t> get_geometry_element_ids_as_uints(const GeometryComponent &compo
BLI_assert(hashes.size() == hash_attribute->size());
const CPPType &cpp_type = hash_attribute->type();
GVArray_GSpan items{*hash_attribute};
- parallel_for(hashes.index_range(), 512, [&](IndexRange range) {
+ threading::parallel_for(hashes.index_range(), 512, [&](IndexRange range) {
for (const int i : range) {
hashes[i] = cpp_type.hash(items[i]);
}
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_sample_texture.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_sample_texture.cc
index d6b1ad3e9e0..e0a3f5ad334 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_sample_texture.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_sample_texture.cc
@@ -90,7 +90,7 @@ static void execute_on_component(GeometryComponent &component, const GeoNodeExec
mapping_name, result_domain, {0, 0, 0});
MutableSpan<ColorGeometry4f> colors = attribute_out.as_span();
- parallel_for(IndexRange(mapping_attribute.size()), 128, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(mapping_attribute.size()), 128, [&](IndexRange range) {
for (const int i : range) {
TexResult texture_result = {0};
const float3 position = mapping_attribute[i];
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc
index b04e04d1cb7..e2cf6e8b480 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc
@@ -186,7 +186,7 @@ static void do_math_operation_fl3_fl3_to_fl3(const VArray<float3> &input_a,
bool success = try_dispatch_float_math_fl3_fl3_to_fl3(
operation, [&](auto math_function, const FloatMathOperationInfo &UNUSED(info)) {
- parallel_for(IndexRange(size), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(size), 512, [&](IndexRange range) {
for (const int i : range) {
const float3 a = span_a[i];
const float3 b = span_b[i];
@@ -218,7 +218,7 @@ static void do_math_operation_fl3_fl3_fl3_to_fl3(const VArray<float3> &input_a,
bool success = try_dispatch_float_math_fl3_fl3_fl3_to_fl3(
operation, [&](auto math_function, const FloatMathOperationInfo &UNUSED(info)) {
- parallel_for(IndexRange(size), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(size), 512, [&](IndexRange range) {
for (const int i : range) {
const float3 a = span_a[i];
const float3 b = span_b[i];
@@ -251,7 +251,7 @@ static void do_math_operation_fl3_fl3_fl_to_fl3(const VArray<float3> &input_a,
bool success = try_dispatch_float_math_fl3_fl3_fl_to_fl3(
operation, [&](auto math_function, const FloatMathOperationInfo &UNUSED(info)) {
- parallel_for(IndexRange(size), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(size), 512, [&](IndexRange range) {
for (const int i : range) {
const float3 a = span_a[i];
const float3 b = span_b[i];
@@ -282,7 +282,7 @@ static void do_math_operation_fl3_fl3_to_fl(const VArray<float3> &input_a,
bool success = try_dispatch_float_math_fl3_fl3_to_fl(
operation, [&](auto math_function, const FloatMathOperationInfo &UNUSED(info)) {
- parallel_for(IndexRange(size), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(size), 512, [&](IndexRange range) {
for (const int i : range) {
const float3 a = span_a[i];
const float3 b = span_b[i];
@@ -312,7 +312,7 @@ static void do_math_operation_fl3_fl_to_fl3(const VArray<float3> &input_a,
bool success = try_dispatch_float_math_fl3_fl_to_fl3(
operation, [&](auto math_function, const FloatMathOperationInfo &UNUSED(info)) {
- parallel_for(IndexRange(size), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(size), 512, [&](IndexRange range) {
for (const int i : range) {
const float3 a = span_a[i];
const float b = span_b[i];
@@ -340,7 +340,7 @@ static void do_math_operation_fl3_to_fl3(const VArray<float3> &input_a,
bool success = try_dispatch_float_math_fl3_to_fl3(
operation, [&](auto math_function, const FloatMathOperationInfo &UNUSED(info)) {
- parallel_for(IndexRange(size), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(size), 512, [&](IndexRange range) {
for (const int i : range) {
const float3 in = span_a[i];
const float3 out = math_function(in);
@@ -367,7 +367,7 @@ static void do_math_operation_fl3_to_fl(const VArray<float3> &input_a,
bool success = try_dispatch_float_math_fl3_to_fl(
operation, [&](auto math_function, const FloatMathOperationInfo &UNUSED(info)) {
- parallel_for(IndexRange(size), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(size), 512, [&](IndexRange range) {
for (const int i : range) {
const float3 in = span_a[i];
const float out = math_function(in);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_rotate.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_rotate.cc
index 4d568ab5c3a..da753dfc11b 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_rotate.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_rotate.cc
@@ -154,7 +154,7 @@ static void do_vector_rotate_around_axis(const VArray<float3> &vector,
VArray_Span<float3> span_axis{axis};
VArray_Span<float> span_angle{angle};
- parallel_for(IndexRange(results.size()), 1024, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(results.size()), 1024, [&](IndexRange range) {
for (const int i : range) {
float angle = (invert) ? -span_angle[i] : span_angle[i];
results[i] = vector_rotate_around_axis(span_vector[i], span_center[i], span_axis[i], angle);
@@ -173,7 +173,7 @@ static void do_vector_rotate_around_fixed_axis(const VArray<float3> &vector,
VArray_Span<float3> span_center{center};
VArray_Span<float> span_angle{angle};
- parallel_for(IndexRange(results.size()), 1024, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(results.size()), 1024, [&](IndexRange range) {
for (const int i : range) {
float angle = (invert) ? -span_angle[i] : span_angle[i];
results[i] = vector_rotate_around_axis(span_vector[i], span_center[i], axis, angle);
@@ -191,7 +191,7 @@ static void do_vector_rotate_euler(const VArray<float3> &vector,
VArray_Span<float3> span_center{center};
VArray_Span<float3> span_rotation{rotation};
- parallel_for(IndexRange(results.size()), 1024, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(results.size()), 1024, [&](IndexRange range) {
for (const int i : range) {
results[i] = vector_rotate_euler(span_vector[i], span_center[i], span_rotation[i], invert);
}
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_reverse.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_reverse.cc
index 47704df5b92..e92d22a6064 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_reverse.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_reverse.cc
@@ -76,7 +76,7 @@ static void geo_node_curve_reverse_exec(GeoNodeExecParams params)
GVArray_Typed<bool> selection = curve_component.attribute_get_for_read(
selection_name, ATTR_DOMAIN_CURVE, true);
- parallel_for(splines.index_range(), 128, [&](IndexRange range) {
+ threading::parallel_for(splines.index_range(), 128, [&](IndexRange range) {
for (const int i : range) {
if (!selection[i]) {
continue;
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc
index 23e1d315534..26ff1dbe9dc 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc
@@ -71,7 +71,7 @@ namespace blender::nodes {
*/
static void evaluate_splines(Span<SplinePtr> splines)
{
- parallel_for_each(splines, [](const SplinePtr &spline) {
+ threading::parallel_for_each(splines, [](const SplinePtr &spline) {
/* These functions fill the corresponding caches on each spline. */
spline->evaluated_positions();
spline->evaluated_tangents();
@@ -192,7 +192,7 @@ static void copy_evaluated_point_attributes(Span<SplinePtr> splines,
Span<int> offsets,
ResultAttributes &data)
{
- parallel_for(splines.index_range(), 64, [&](IndexRange range) {
+ threading::parallel_for(splines.index_range(), 64, [&](IndexRange range) {
for (const int i : range) {
const Spline &spline = *splines[i];
const int offset = offsets[i];
@@ -225,7 +225,7 @@ static void copy_uniform_sample_point_attributes(Span<SplinePtr> splines,
Span<int> offsets,
ResultAttributes &data)
{
- parallel_for(splines.index_range(), 64, [&](IndexRange range) {
+ threading::parallel_for(splines.index_range(), 64, [&](IndexRange range) {
for (const int i : range) {
const Spline &spline = *splines[i];
const int offset = offsets[i];
@@ -313,7 +313,7 @@ static void copy_spline_domain_attributes(const CurveComponent &curve_component,
static void create_default_rotation_attribute(ResultAttributes &data)
{
- parallel_for(IndexRange(data.result_size), 512, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(data.result_size), 512, [&](IndexRange range) {
for (const int i : range) {
data.rotations[i] = float4x4::from_normalized_axis_data(
{0, 0, 0}, data.normals[i], data.tangents[i])
diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_curve.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_curve.cc
index 0fb7910c904..637003a46c7 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_curve.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_curve.cc
@@ -62,7 +62,7 @@ static void copy_attributes_to_points(CurveEval &curve,
if (source_attribute_names.contains_as("tilt")) {
const GVArray_Typed<float> tilt_attribute = mesh_component.attribute_get_for_read<float>(
"tilt", ATTR_DOMAIN_POINT, 0.0f);
- parallel_for(splines.index_range(), 256, [&](IndexRange range) {
+ threading::parallel_for(splines.index_range(), 256, [&](IndexRange range) {
for (const int i : range) {
copy_attribute_to_points<float>(
*tilt_attribute, point_to_vert_maps[i], splines[i]->tilts());
@@ -73,7 +73,7 @@ static void copy_attributes_to_points(CurveEval &curve,
if (source_attribute_names.contains_as("radius")) {
const GVArray_Typed<float> radius_attribute = mesh_component.attribute_get_for_read<float>(
"radius", ATTR_DOMAIN_POINT, 1.0f);
- parallel_for(splines.index_range(), 256, [&](IndexRange range) {
+ threading::parallel_for(splines.index_range(), 256, [&](IndexRange range) {
for (const int i : range) {
copy_attribute_to_points<float>(
*radius_attribute, point_to_vert_maps[i], splines[i]->radii());
@@ -97,7 +97,7 @@ static void copy_attributes_to_points(CurveEval &curve,
const CustomDataType data_type = bke::cpp_type_to_custom_data_type(mesh_attribute->type());
- parallel_for(splines.index_range(), 128, [&](IndexRange range) {
+ threading::parallel_for(splines.index_range(), 128, [&](IndexRange range) {
for (const int i : range) {
/* Create attribute on the spline points. */
splines[i]->attributes.create(name, data_type);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_point_instance.cc b/source/blender/nodes/geometry/nodes/node_geo_point_instance.cc
index e52ab1b2127..b119b7b31e9 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_point_instance.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_point_instance.cc
@@ -189,7 +189,7 @@ static void add_instances_from_component(InstancesComponent &instances,
* (anything except for collection mode with "Whole Collection" turned off). */
if (possible_handles.size() == 1) {
const int handle = possible_handles.first();
- parallel_for(IndexRange(domain_size), 1024, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(domain_size), 1024, [&](IndexRange range) {
for (const int i : range) {
handles[i] = handle;
transforms[i] = float4x4::from_loc_eul_scale(positions[i], rotations[i], scales[i]);
@@ -200,7 +200,7 @@ static void add_instances_from_component(InstancesComponent &instances,
else {
const int seed = params.get_input<int>("Seed");
Array<uint32_t> ids = get_geometry_element_ids_as_uints(src_geometry, ATTR_DOMAIN_POINT);
- parallel_for(IndexRange(domain_size), 1024, [&](IndexRange range) {
+ threading::parallel_for(IndexRange(domain_size), 1024, [&](IndexRange range) {
for (const int i : range) {
const int index = BLI_hash_int_2d(ids[i], seed) % possible_handles.size();
const int handle = possible_handles[index];
diff --git a/source/blender/nodes/geometry/nodes/node_geo_select_by_material.cc b/source/blender/nodes/geometry/nodes/node_geo_select_by_material.cc
index 9bc963eec43..ee114741a77 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_select_by_material.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_select_by_material.cc
@@ -60,7 +60,7 @@ static void select_mesh_by_material(const Mesh &mesh,
material_indices.append(i);
}
}
- parallel_for(r_selection.index_range(), 1024, [&](IndexRange range) {
+ threading::parallel_for(r_selection.index_range(), 1024, [&](IndexRange range) {
for (const int i : range) {
r_selection[i] = material_indices.contains(mesh.mpoly[i].mat_nr);
}