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:
authorHans Goudey <h.goudey@me.com>2022-10-19 20:38:48 +0300
committerHans Goudey <h.goudey@me.com>2022-10-19 20:38:48 +0300
commita803dbe7ed80df577b648f9e289aaed2a2cc1700 (patch)
treefd8ad9e281530a070e485db82af31029e2754e76 /source/blender/blenlib/intern
parente6902d19a0d8b034e65f28df6dba914a876b08df (diff)
Geometry Nodes: Use common utility for copying attribute data
Attribute copying often uses identical logic for copying selected elements or copying with an index map. Instead of reimplementing this in each file, use the common implementation in the array_utils namespace. This makes the commonality more obvious, gives improved performance (this implementation is multithreaded), reduces binary size (I observed a 173KB reduction), and probably reduces compile time.
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r--source/blender/blenlib/intern/array_utils.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/array_utils.cc b/source/blender/blenlib/intern/array_utils.cc
index a837d6aceec..2a231228dcb 100644
--- a/source/blender/blenlib/intern/array_utils.cc
+++ b/source/blender/blenlib/intern/array_utils.cc
@@ -28,4 +28,9 @@ void gather(const GVArray &src,
});
}
+void gather(const GSpan src, const IndexMask indices, GMutableSpan dst, const int64_t grain_size)
+{
+ gather(GVArray::ForSpan(src), indices, dst, grain_size);
+}
+
} // namespace blender::array_utils