diff options
author | Jacques Lucke <jacques@blender.org> | 2021-05-10 11:28:24 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-05-10 11:28:24 +0300 |
commit | 0061150e4c90de474a38bd2eeeea7fe0d12de353 (patch) | |
tree | 64c8daef509e1b7801f110eaab8f61e0d4ec1887 /source/blender/functions/FN_generic_virtual_array.hh | |
parent | f2370bb22d7fd9b03a46c2df1f0eb9c2cd6676b2 (diff) |
Functions: support materialize virtual array to initialized span
Diffstat (limited to 'source/blender/functions/FN_generic_virtual_array.hh')
-rw-r--r-- | source/blender/functions/FN_generic_virtual_array.hh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/functions/FN_generic_virtual_array.hh b/source/blender/functions/FN_generic_virtual_array.hh index 2e91479dd30..aca752583c4 100644 --- a/source/blender/functions/FN_generic_virtual_array.hh +++ b/source/blender/functions/FN_generic_virtual_array.hh @@ -135,6 +135,9 @@ class GVArray { this->get_internal_single(r_value); } + void materialize(void *dst) const; + void materialize(const IndexMask mask, void *dst) const; + void materialize_to_uninitialized(void *dst) const; void materialize_to_uninitialized(const IndexMask mask, void *dst) const; @@ -162,6 +165,7 @@ class GVArray { virtual bool is_single_impl() const; virtual void get_internal_single_impl(void *UNUSED(r_value)) const; + virtual void materialize_impl(const IndexMask mask, void *dst) const; virtual void materialize_to_uninitialized_impl(const IndexMask mask, void *dst) const; virtual const void *try_get_internal_varray_impl() const; @@ -370,6 +374,11 @@ template<typename T> class GVArray_For_VArray : public GVArray { *(T *)r_value = varray_->get_internal_single(); } + void materialize_impl(const IndexMask mask, void *dst) const override + { + varray_->materialize(mask, MutableSpan((T *)dst, mask.min_array_size())); + } + void materialize_to_uninitialized_impl(const IndexMask mask, void *dst) const override { varray_->materialize_to_uninitialized(mask, MutableSpan((T *)dst, mask.min_array_size())); |