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-05-10 11:28:24 +0300
committerJacques Lucke <jacques@blender.org>2021-05-10 11:28:24 +0300
commit0061150e4c90de474a38bd2eeeea7fe0d12de353 (patch)
tree64c8daef509e1b7801f110eaab8f61e0d4ec1887 /source/blender/functions/intern
parentf2370bb22d7fd9b03a46c2df1f0eb9c2cd6676b2 (diff)
Functions: support materialize virtual array to initialized span
Diffstat (limited to 'source/blender/functions/intern')
-rw-r--r--source/blender/functions/intern/generic_virtual_array.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/functions/intern/generic_virtual_array.cc b/source/blender/functions/intern/generic_virtual_array.cc
index ca2bd0f806f..a835e7a54a9 100644
--- a/source/blender/functions/intern/generic_virtual_array.cc
+++ b/source/blender/functions/intern/generic_virtual_array.cc
@@ -53,6 +53,24 @@ class GVArray_For_ShallowCopy : public GVArray {
* GVArray.
*/
+void GVArray::materialize(void *dst) const
+{
+ this->materialize(IndexMask(size_), dst);
+}
+
+void GVArray::materialize(const IndexMask mask, void *dst) const
+{
+ this->materialize_impl(mask, dst);
+}
+
+void GVArray::materialize_impl(const IndexMask mask, void *dst) const
+{
+ for (const int64_t i : mask) {
+ void *elem_dst = POINTER_OFFSET(dst, type_->size() * i);
+ this->get(i, elem_dst);
+ }
+}
+
void GVArray::materialize_to_uninitialized(void *dst) const
{
this->materialize_to_uninitialized(IndexMask(size_), dst);