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:
authorIliay Katueshenock <Moder>2022-08-03 18:17:36 +0300
committerHans Goudey <h.goudey@me.com>2022-08-03 18:18:02 +0300
commit55a332da6470b504a489cce59048324a1ea6d161 (patch)
tree6e808819df9f2872d526f5934f5f9b79eb72efb9 /source/blender/geometry
parent144027d70ffc400040916ca15c7eed91e78e9c57 (diff)
Attribute Math: Improve performance of mixer in some cases
The `DefaultMixer` for mixing generic data types has some issues: 1. The full buffer is always zeroed, even if only some is used. 2. Finalizing also works on all values, even if only some are used. 3. "mixing" doesn't allow setting the first value, requiring that everything is cleared beforehand. This commit adds the following functionality: 1. Constructor with the specified `IndexMask` for preliminary zeroing. 2. `set` method to overwrite the value. 3. `finalize` with the specified mask to process a subset of values. This is useful in situations where you want to use the DefaultMixer without having to overwrite all the values many times. A performance improvement was observed for NURBS curve evaluation and attribute interpolation from the point to curve domain of about 15% and 35% respectively (100,000 curves). Differential Revision: https://developer.blender.org/D15434
Diffstat (limited to 'source/blender/geometry')
-rw-r--r--source/blender/geometry/intern/add_curves_on_mesh.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/geometry/intern/add_curves_on_mesh.cc b/source/blender/geometry/intern/add_curves_on_mesh.cc
index 7184d774a22..299040d4d32 100644
--- a/source/blender/geometry/intern/add_curves_on_mesh.cc
+++ b/source/blender/geometry/intern/add_curves_on_mesh.cc
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_length_parameterize.hh"
+#include "BLI_task.hh"
#include "BKE_attribute_math.hh"
#include "BKE_mesh_sample.hh"
@@ -102,8 +103,8 @@ void interpolate_from_neighbors(const Span<NeighborCurves> neighbors_per_curve,
}
}
}
+ mixer.finalize(range);
});
- mixer.finalize();
}
static void interpolate_position_without_interpolation(