diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-12-11 17:08:54 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-12-11 17:08:54 +0300 |
commit | 2a25a0bd60f9de25868bc0fdc797fdbd7708a131 (patch) | |
tree | 0d1af043b5e4dfe27eb1e330da39c5c84c63fcdb /source | |
parent | a080464e310aecf5d0ca7294a1b3e9d0b4b1023d (diff) |
cleanup
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/functions/intern/multi_functions/vectorize.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/source/blender/functions/intern/multi_functions/vectorize.cc b/source/blender/functions/intern/multi_functions/vectorize.cc index 128d628a622..1a8f107b47e 100644 --- a/source/blender/functions/intern/multi_functions/vectorize.cc +++ b/source/blender/functions/intern/multi_functions/vectorize.cc @@ -12,9 +12,12 @@ MF_SimpleVectorize::MF_SimpleVectorize(const MultiFunction &function, bool found_output_param = false; UNUSED_VARS_NDEBUG(found_output_param); + for (uint param_index : function.param_indices()) { MFParamType param_type = function.param_type(param_index); + MFDataType data_type = param_type.data_type(); StringRef param_name = function.param_name(param_index); + switch (param_type.type()) { case MFParamType::VectorInput: case MFParamType::VectorOutput: @@ -26,17 +29,16 @@ MF_SimpleVectorize::MF_SimpleVectorize(const MultiFunction &function, case MFParamType::SingleInput: { BLI_assert(!found_output_param); if (input_is_vectorized[param_index]) { - signature.vector_input(param_name + " (List)", - param_type.data_type().single__cpp_type()); + signature.vector_input(param_name + " (List)", data_type.single__cpp_type()); m_vectorized_inputs.append(param_index); } else { - signature.single_input(param_name, param_type.data_type().single__cpp_type()); + signature.single_input(param_name, data_type.single__cpp_type()); } break; } case MFParamType::SingleOutput: { - signature.vector_output(param_name + " (List)", param_type.data_type().single__cpp_type()); + signature.vector_output(param_name + " (List)", data_type.single__cpp_type()); m_output_indices.append(param_index); found_output_param = true; break; @@ -57,8 +59,7 @@ void MF_SimpleVectorize::call(MFMask mask, MFParams params, MFContext context) c vectorization_lengths.fill_indices(mask.indices(), -1); for (uint param_index : m_vectorized_inputs) { - GenericVirtualListListRef values = params.readonly_vector_input(param_index, - this->param_name(param_index)); + GenericVirtualListListRef values = params.readonly_vector_input(param_index); for (uint i : mask.indices()) { if (vectorization_lengths[i] != 0) { vectorization_lengths[i] = std::max<int>(vectorization_lengths[i], values[i].size()); @@ -89,22 +90,19 @@ void MF_SimpleVectorize::call(MFMask mask, MFParams params, MFContext context) c } case MFParamType::SingleInput: { if (m_input_is_vectorized[param_index]) { - GenericVirtualListListRef input_list_list = params.readonly_vector_input( - param_index, this->param_name(param_index)); + GenericVirtualListListRef input_list_list = params.readonly_vector_input(param_index); GenericVirtualListRef repeated_input = input_list_list.repeated_sublist(index, length); params_builder.add_readonly_single_input(repeated_input); } else { - GenericVirtualListRef input_list = params.readonly_single_input( - param_index, this->param_name(param_index)); + GenericVirtualListRef input_list = params.readonly_single_input(param_index); GenericVirtualListRef repeated_input = input_list.repeated_element(index, length); params_builder.add_readonly_single_input(repeated_input); } break; } case MFParamType::SingleOutput: { - GenericVectorArray &output_array_list = params.vector_output( - param_index, this->param_name(param_index)); + GenericVectorArray &output_array_list = params.vector_output(param_index); GenericMutableArrayRef output_array = output_array_list.allocate_single(index, length); params_builder.add_single_output(output_array); break; |