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:
Diffstat (limited to 'source/blender/blenlib/intern/generic_virtual_array.cc')
-rw-r--r--source/blender/blenlib/intern/generic_virtual_array.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/generic_virtual_array.cc b/source/blender/blenlib/intern/generic_virtual_array.cc
index 7a2b45ff857..3764367b6b7 100644
--- a/source/blender/blenlib/intern/generic_virtual_array.cc
+++ b/source/blender/blenlib/intern/generic_virtual_array.cc
@@ -24,6 +24,22 @@ void GVArrayImpl::materialize_to_uninitialized(const IndexMask mask, void *dst)
}
}
+void GVArrayImpl::materialize_compressed(IndexMask mask, void *dst) const
+{
+ for (const int64_t i : mask.index_range()) {
+ void *elem_dst = POINTER_OFFSET(dst, type_->size() * i);
+ this->get(mask[i], elem_dst);
+ }
+}
+
+void GVArrayImpl::materialize_compressed_to_uninitialized(IndexMask mask, void *dst) const
+{
+ for (const int64_t i : mask.index_range()) {
+ void *elem_dst = POINTER_OFFSET(dst, type_->size() * i);
+ this->get_to_uninitialized(mask[i], elem_dst);
+ }
+}
+
void GVArrayImpl::get(const int64_t index, void *r_value) const
{
type_->destruct(r_value);
@@ -182,6 +198,17 @@ void GVArrayImpl_For_GSpan::materialize_to_uninitialized(const IndexMask mask, v
type_->copy_construct_indices(data_, dst, mask);
}
+void GVArrayImpl_For_GSpan::materialize_compressed(const IndexMask mask, void *dst) const
+{
+ type_->copy_assign_compressed(data_, dst, mask);
+}
+
+void GVArrayImpl_For_GSpan::materialize_compressed_to_uninitialized(const IndexMask mask,
+ void *dst) const
+{
+ type_->copy_construct_compressed(data_, dst, mask);
+}
+
class GVArrayImpl_For_GSpan_final final : public GVArrayImpl_For_GSpan {
public:
using GVArrayImpl_For_GSpan::GVArrayImpl_For_GSpan;