Geometry Nodes: De-duplicate index input nodes during evaluation
We do this in other nodes to reduce overhead of using the same node more than once. I don't think it will make a difference with index nodes currently, but at least it's consistent.
This commit is contained in:
parent
482c5f0014
commit
a3457704fb
|
@ -421,6 +421,9 @@ class IndexFieldInput final : public FieldInput {
|
|||
const GVArray *get_varray_for_context(const FieldContext &context,
|
||||
IndexMask mask,
|
||||
ResourceScope &scope) const final;
|
||||
|
||||
uint64_t hash() const override;
|
||||
bool is_equal_to(const fn::FieldNode &other) const override;
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -530,6 +530,17 @@ const GVArray *IndexFieldInput::get_varray_for_context(const fn::FieldContext &U
|
|||
mask.min_array_size(), mask.min_array_size(), index_func);
|
||||
}
|
||||
|
||||
uint64_t IndexFieldInput::hash() const
|
||||
{
|
||||
/* Some random constant hash. */
|
||||
return 128736487678;
|
||||
}
|
||||
|
||||
bool IndexFieldInput::is_equal_to(const fn::FieldNode &other) const
|
||||
{
|
||||
return dynamic_cast<const IndexFieldInput *>(&other) != nullptr;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------
|
||||
* FieldOperation.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue