diff options
author | Jacques Lucke <jacques@blender.org> | 2021-11-26 12:08:19 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-11-26 12:08:19 +0300 |
commit | 6b5e1cfacab4c4605ec2d7bfef360389afe849be (patch) | |
tree | e9823126bbe86b31cb0add5d536e1f0a1390b43a /source/blender/functions/intern | |
parent | 2cda65a35a61e0bb74f4b2b896feede73c329b59 (diff) |
Geometry Nodes: better devirtualization for sliced virtual arrays
Under some circumstances that can lead to more than a 2x
performance increase, because math nodes can better optimize
for the case when the slice is a single value or span.
Diffstat (limited to 'source/blender/functions/intern')
-rw-r--r-- | source/blender/functions/intern/generic_virtual_array.cc | 18 |
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 160234c6e61..625aa2cd50f 100644 --- a/source/blender/functions/intern/generic_virtual_array.cc +++ b/source/blender/functions/intern/generic_virtual_array.cc @@ -496,6 +496,24 @@ class GVArrayImpl_For_SlicedGVArray : public GVArrayImpl { { varray_.get_to_uninitialized(index + offset_, r_value); } + + bool is_span() const override + { + return varray_.is_span(); + } + GSpan get_internal_span() const override + { + return varray_.get_internal_span(); + } + + bool is_single() const override + { + return varray_.is_single(); + } + void get_internal_single(void *r_value) const override + { + varray_.get_internal_single(r_value); + } }; /** \} */ |