From 2d4c7fa896ab4a6de163cd33746b54e67c7f8bac Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 6 Dec 2021 19:05:29 +0100 Subject: Geometry Nodes: reduce code duplication with new GeometyrFieldInput Most of our field inputs are currently specific to geometry. This patch introduces a new `GeometryFieldInput` that reduces the overhead of adding new geometry field input. Differential Revision: https://developer.blender.org/D13489 --- source/blender/functions/intern/field.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/functions/intern') diff --git a/source/blender/functions/intern/field.cc b/source/blender/functions/intern/field.cc index 297df3c15cf..27f213f2ba3 100644 --- a/source/blender/functions/intern/field.cc +++ b/source/blender/functions/intern/field.cc @@ -531,7 +531,7 @@ IndexFieldInput::IndexFieldInput() : FieldInput(CPPType::get(), "Index") category_ = Category::Generated; } -GVArray IndexFieldInput::get_index_varray(IndexMask mask, ResourceScope &UNUSED(scope)) +GVArray IndexFieldInput::get_index_varray(IndexMask mask) { auto index_func = [](int i) { return i; }; return VArray::ForFunc(mask.min_array_size(), index_func); @@ -539,10 +539,10 @@ GVArray IndexFieldInput::get_index_varray(IndexMask mask, ResourceScope &UNUSED( GVArray IndexFieldInput::get_varray_for_context(const fn::FieldContext &UNUSED(context), IndexMask mask, - ResourceScope &scope) const + ResourceScope &UNUSED(scope)) const { /* TODO: Investigate a similar method to IndexRange::as_span() */ - return get_index_varray(mask, scope); + return get_index_varray(mask); } uint64_t IndexFieldInput::hash() const -- cgit v1.2.3