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:
authorHans Goudey <h.goudey@me.com>2021-10-19 04:13:37 +0300
committerHans Goudey <h.goudey@me.com>2021-10-19 04:13:37 +0300
commita3457704fb63a59045b093dc4499b43f6676fabb (patch)
tree73a9dfa113c80c002ba1764b96646ccf953bdbe5 /source/blender/functions/intern
parent482c5f001449f6bbb57c4d01363600879607099e (diff)
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.
Diffstat (limited to 'source/blender/functions/intern')
-rw-r--r--source/blender/functions/intern/field.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/functions/intern/field.cc b/source/blender/functions/intern/field.cc
index 03af3f53065..1f7bad134a8 100644
--- a/source/blender/functions/intern/field.cc
+++ b/source/blender/functions/intern/field.cc
@@ -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.
*/