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-11-26 12:08:19 +0300
committerJacques Lucke <jacques@blender.org>2021-11-26 12:08:19 +0300
commit6b5e1cfacab4c4605ec2d7bfef360389afe849be (patch)
treee9823126bbe86b31cb0add5d536e1f0a1390b43a /source/blender/functions
parent2cda65a35a61e0bb74f4b2b896feede73c329b59 (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')
-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 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);
+ }
};
/** \} */