Changeset View
Changeset View
Standalone View
Standalone View
source/blender/functions/intern/field.cc
| Show First 20 Lines • Show All 513 Lines • ▼ Show 20 Lines | const GVArray *FieldContext::get_varray_for_input(const FieldInput &field_input, | ||||
| * the context here. */ | * the context here. */ | ||||
| return field_input.get_varray_for_context(*this, mask, scope); | return field_input.get_varray_for_context(*this, mask, scope); | ||||
| } | } | ||||
| IndexFieldInput::IndexFieldInput() : FieldInput(CPPType::get<int>(), "Index") | IndexFieldInput::IndexFieldInput() : FieldInput(CPPType::get<int>(), "Index") | ||||
| { | { | ||||
| } | } | ||||
| const GVArray *IndexFieldInput::get_varray_for_context(const fn::FieldContext &UNUSED(context), | GVArray *IndexFieldInput::get_index_varray(IndexMask mask, ResourceScope &scope) | ||||
| IndexMask mask, | |||||
| ResourceScope &scope) const | |||||
| { | { | ||||
| /* TODO: Investigate a similar method to IndexRange::as_span() */ | |||||
| auto index_func = [](int i) { return i; }; | auto index_func = [](int i) { return i; }; | ||||
| return &scope.construct< | return &scope.construct< | ||||
| fn::GVArray_For_EmbeddedVArray<int, VArray_For_Func<int, decltype(index_func)>>>( | fn::GVArray_For_EmbeddedVArray<int, VArray_For_Func<int, decltype(index_func)>>>( | ||||
| mask.min_array_size(), mask.min_array_size(), index_func); | mask.min_array_size(), mask.min_array_size(), index_func); | ||||
| } | } | ||||
| const GVArray *IndexFieldInput::get_varray_for_context(const fn::FieldContext &UNUSED(context), | |||||
| IndexMask mask, | |||||
| ResourceScope &scope) const | |||||
| { | |||||
| /* TODO: Investigate a similar method to IndexRange::as_span() */ | |||||
| return get_index_varray(mask, scope); | |||||
| } | |||||
| uint64_t IndexFieldInput::hash() const | uint64_t IndexFieldInput::hash() const | ||||
| { | { | ||||
| /* Some random constant hash. */ | /* Some random constant hash. */ | ||||
| return 128736487678; | return 128736487678; | ||||
| } | } | ||||
| bool IndexFieldInput::is_equal_to(const fn::FieldNode &other) const | bool IndexFieldInput::is_equal_to(const fn::FieldNode &other) const | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines | |||||