diff options
author | Hans Goudey <h.goudey@me.com> | 2022-10-19 20:38:48 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-10-19 20:38:48 +0300 |
commit | a803dbe7ed80df577b648f9e289aaed2a2cc1700 (patch) | |
tree | fd8ad9e281530a070e485db82af31029e2754e76 /source/blender/blenlib/intern | |
parent | e6902d19a0d8b034e65f28df6dba914a876b08df (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.cc | 5 |
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 |