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.
This commit is contained in:
Jacques Lucke 2021-11-26 10:08:19 +01:00
parent 2cda65a35a
commit 6b5e1cfaca
Notes: blender-bot 2023-02-14 08:42:53 +01:00
Referenced by commit 63342861e7, Fix: error in previous commit
Referenced by issue #91944, Switching in and out of local view in rendered mode in Cycles can cause a crash in heavy scenes
1 changed files with 18 additions and 0 deletions

View File

@ -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);
}
};
/** \} */