[Bf-blender-cvs] [b0e21a37e4d] temp-lineart-contained: Functions: Add materialize methods for generic mutable virtual array

Hans Goudey noreply at git.blender.org
Wed May 12 04:15:51 CEST 2021


Commit: b0e21a37e4d7544334ae5119e89c323c237b6a07
Author: Hans Goudey
Date:   Mon May 10 19:12:04 2021 -0500
Branches: temp-lineart-contained
https://developer.blender.org/rBb0e21a37e4d7544334ae5119e89c323c237b6a07

Functions: Add materialize methods for generic mutable virtual array

Similar to how `GVArray_For_VArray` implements `materialize_impl` to
forward the work to its non-generic virtual array, we can do the same
thing for the mutable version, `GVMutableArray_For_VMutableArray`.

This commit should have no visible changes, since as far as I can tell
the only user of this class does not implement special materialize
methods anyway.

===================================================================

M	source/blender/functions/FN_generic_virtual_array.hh

===================================================================

diff --git a/source/blender/functions/FN_generic_virtual_array.hh b/source/blender/functions/FN_generic_virtual_array.hh
index aca752583c4..12454fe08f3 100644
--- a/source/blender/functions/FN_generic_virtual_array.hh
+++ b/source/blender/functions/FN_generic_virtual_array.hh
@@ -554,6 +554,16 @@ template<typename T> class GVMutableArray_For_VMutableArray : public GVMutableAr
     varray_->set(index, std::move(value_));
   }
 
+  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()));
+  }
+
   const void *try_get_internal_varray_impl() const override
   {
     return (const VArray<T> *)varray_;



More information about the Bf-blender-cvs mailing list