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:
Diffstat (limited to 'source/blender/functions')
-rw-r--r--source/blender/functions/intern/field.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/functions/intern/field.cc b/source/blender/functions/intern/field.cc
index 986d6ddc19e..944674c23a9 100644
--- a/source/blender/functions/intern/field.cc
+++ b/source/blender/functions/intern/field.cc
@@ -468,16 +468,21 @@ Vector<GVArray> evaluate_fields(ResourceScope &scope,
/* Still have to copy over the data in the destination provided by the caller. */
if (dst_varray.is_span()) {
/* Materialize into a span. */
- computed_varray.materialize_to_uninitialized(mask, dst_varray.get_internal_span().data());
+ threading::parallel_for(mask.index_range(), 2048, [&](const IndexRange range) {
+ computed_varray.materialize_to_uninitialized(mask.slice(range),
+ dst_varray.get_internal_span().data());
+ });
}
else {
/* Slower materialize into a different structure. */
const CPPType &type = computed_varray.type();
- BUFFER_FOR_CPP_TYPE_VALUE(type, buffer);
- for (const int i : mask) {
- computed_varray.get_to_uninitialized(i, buffer);
- dst_varray.set_by_relocate(i, buffer);
- }
+ threading::parallel_for(mask.index_range(), 2048, [&](const IndexRange range) {
+ BUFFER_FOR_CPP_TYPE_VALUE(type, buffer);
+ for (const int i : mask.slice(range)) {
+ computed_varray.get_to_uninitialized(i, buffer);
+ dst_varray.set_by_relocate(i, buffer);
+ }
+ });
}
r_varrays[out_index] = dst_varray;
}