[Bf-blender-cvs] [50980981e32] master: Cleanup: remove MF prefix from some classes in multi-function namespace

Jacques Lucke noreply at git.blender.org
Sat Jan 14 15:43:03 CET 2023


Commit: 50980981e32667b1a4478a8013b1c78cf1cc5aa5
Author: Jacques Lucke
Date:   Sat Jan 14 15:42:52 2023 +0100
Branches: master
https://developer.blender.org/rB50980981e32667b1a4478a8013b1c78cf1cc5aa5

Cleanup: remove MF prefix from some classes in multi-function namespace

This was missing in rBeedcf1876a6651c38d8f4daa2e65d1fb81f77c5d.

===================================================================

M	source/blender/functions/FN_multi_function.hh
M	source/blender/functions/FN_multi_function_builder.hh
M	source/blender/functions/FN_multi_function_param_type.hh
M	source/blender/functions/FN_multi_function_params.hh
M	source/blender/functions/FN_multi_function_procedure.hh
M	source/blender/functions/FN_multi_function_procedure_executor.hh
M	source/blender/functions/FN_multi_function_signature.hh
M	source/blender/functions/intern/multi_function.cc
M	source/blender/functions/intern/multi_function_builder.cc
M	source/blender/functions/intern/multi_function_procedure.cc
M	source/blender/functions/intern/multi_function_procedure_executor.cc
M	source/blender/functions/tests/FN_field_test.cc
M	source/blender/functions/tests/FN_multi_function_test.cc
M	source/blender/functions/tests/FN_multi_function_test_common.hh
M	source/blender/nodes/function/nodes/node_fn_align_euler_to_vector.cc
M	source/blender/nodes/function/nodes/node_fn_input_special_characters.cc
M	source/blender/nodes/function/nodes/node_fn_separate_color.cc
M	source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc
M	source/blender/nodes/geometry/nodes/node_geo_image_texture.cc
M	source/blender/nodes/geometry/nodes/node_geo_proximity.cc
M	source/blender/nodes/geometry/nodes/node_geo_raycast.cc
M	source/blender/nodes/geometry/nodes/node_geo_sample_index.cc
M	source/blender/nodes/geometry/nodes/node_geo_sample_nearest.cc
M	source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc
M	source/blender/nodes/geometry/nodes/node_geo_sample_uv_surface.cc
M	source/blender/nodes/shader/nodes/node_shader_color_ramp.cc
M	source/blender/nodes/shader/nodes/node_shader_curves.cc
M	source/blender/nodes/shader/nodes/node_shader_math.cc
M	source/blender/nodes/shader/nodes/node_shader_mix.cc
M	source/blender/nodes/shader/nodes/node_shader_mix_rgb.cc
M	source/blender/nodes/shader/nodes/node_shader_sepcomb_rgb.cc
M	source/blender/nodes/shader/nodes/node_shader_sepcomb_xyz.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_brick.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_checker.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_gradient.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_magic.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_noise.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_wave.cc
M	source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc

===================================================================

diff --git a/source/blender/functions/FN_multi_function.hh b/source/blender/functions/FN_multi_function.hh
index 7a281809e4e..c00b0eb7b40 100644
--- a/source/blender/functions/FN_multi_function.hh
+++ b/source/blender/functions/FN_multi_function.hh
@@ -18,8 +18,8 @@
  * combination of input and output).
  *
  * To call a multi-function, one has to provide three things:
- * - `MFParams`: This references the input and output arrays that the function works with. The
- *      arrays are not owned by MFParams.
+ * - `Params`: This references the input and output arrays that the function works with. The
+ *      arrays are not owned by Params.
  * - `IndexMask`: An array of indices indicating which indices in the provided arrays should be
  *      touched/processed.
  * - `Context`: Further information for the called function.
@@ -52,8 +52,8 @@ class MultiFunction {
    * - Automatic index mask offsetting to avoid large temporary intermediate arrays that are mostly
    *   unused.
    */
-  void call_auto(IndexMask mask, MFParams params, Context context) const;
-  virtual void call(IndexMask mask, MFParams params, Context context) const = 0;
+  void call_auto(IndexMask mask, Params params, Context context) const;
+  virtual void call(IndexMask mask, Params params, Context context) const = 0;
 
   virtual uint64_t hash() const
   {
diff --git a/source/blender/functions/FN_multi_function_builder.hh b/source/blender/functions/FN_multi_function_builder.hh
index bb366ea47ea..b1996ac8f43 100644
--- a/source/blender/functions/FN_multi_function_builder.hh
+++ b/source/blender/functions/FN_multi_function_builder.hh
@@ -371,12 +371,12 @@ template<typename ElementFn, typename ExecPreset, typename... ParamTags, size_t.
 inline void execute_element_fn_as_multi_function(const ElementFn element_fn,
                                                  const ExecPreset exec_preset,
                                                  const IndexMask mask,
-                                                 MFParams params,
+                                                 Params params,
                                                  TypeSequence<ParamTags...> /*param_tags*/,
                                                  std::index_sequence<I...> /*indices*/)
 {
 
-  /* Load parameters from #MFParams. */
+  /* Load parameters from #Params. */
   /* Contains `const GVArrayImpl *` for inputs and `T *` for outputs. */
   const auto loaded_params = std::make_tuple([&]() {
     /* Use `typedef` instead of `using` to work around a compiler bug. */
@@ -453,7 +453,7 @@ inline auto build_multi_function_call_from_element_fn(const ElementFn element_fn
                                                       const ExecPreset exec_preset,
                                                       TypeSequence<ParamTags...> /*param_tags*/)
 {
-  return [element_fn, exec_preset](const IndexMask mask, MFParams params) {
+  return [element_fn, exec_preset](const IndexMask mask, Params params) {
     execute_element_fn_as_multi_function(element_fn,
                                          exec_preset,
                                          mask,
@@ -481,7 +481,7 @@ template<typename CallFn, typename... ParamTags> class CustomMF : public MultiFu
     this->set_signature(&signature_);
   }
 
-  void call(IndexMask mask, MFParams params, Context /*context*/) const override
+  void call(IndexMask mask, Params params, Context /*context*/) const override
   {
     call_fn_(mask, params);
   }
@@ -493,8 +493,8 @@ inline auto build_multi_function_with_n_inputs_one_output(const char *name,
                                                           const ExecPreset exec_preset,
                                                           TypeSequence<In...> /*in_types*/)
 {
-  constexpr auto param_tags = TypeSequence<MFParamTag<ParamCategory::SingleInput, In>...,
-                                           MFParamTag<ParamCategory::SingleOutput, Out>>();
+  constexpr auto param_tags = TypeSequence<ParamTag<ParamCategory::SingleInput, In>...,
+                                           ParamTag<ParamCategory::SingleOutput, Out>>();
   auto call_fn = build_multi_function_call_from_element_fn(
       [element_fn](const In &...in, Out &out) { new (&out) Out(element_fn(in...)); },
       exec_preset,
@@ -603,7 +603,7 @@ inline auto SM(const char *name,
                const ElementFn element_fn,
                const ExecPreset exec_preset = exec_presets::AllSpanOrSingle())
 {
-  constexpr auto param_tags = TypeSequence<MFParamTag<ParamCategory::SingleMutable, Mut1>>();
+  constexpr auto param_tags = TypeSequence<ParamTag<ParamCategory::SingleMutable, Mut1>>();
   auto call_fn = detail::build_multi_function_call_from_element_fn(
       element_fn, exec_preset, param_tags);
   return detail::CustomMF(name, call_fn, param_tags);
@@ -630,7 +630,7 @@ class CustomMF_GenericConstant : public MultiFunction {
  public:
   CustomMF_GenericConstant(const CPPType &type, const void *value, bool make_value_copy);
   ~CustomMF_GenericConstant();
-  void call(IndexMask mask, MFParams params, Context context) const override;
+  void call(IndexMask mask, Params params, Context context) const override;
   uint64_t hash() const override;
   bool equals(const MultiFunction &other) const override;
 };
@@ -646,7 +646,7 @@ class CustomMF_GenericConstantArray : public MultiFunction {
 
  public:
   CustomMF_GenericConstantArray(GSpan array);
-  void call(IndexMask mask, MFParams params, Context context) const override;
+  void call(IndexMask mask, Params params, Context context) const override;
 };
 
 /**
@@ -665,7 +665,7 @@ template<typename T> class CustomMF_Constant : public MultiFunction {
     this->set_signature(&signature_);
   }
 
-  void call(IndexMask mask, MFParams params, Context /*context*/) const override
+  void call(IndexMask mask, Params params, Context /*context*/) const override
   {
     MutableSpan<T> output = params.uninitialized_single_output<T>(0);
     mask.to_best_mask_type([&](const auto &mask) {
@@ -705,7 +705,7 @@ class CustomMF_DefaultOutput : public MultiFunction {
 
  public:
   CustomMF_DefaultOutput(Span<DataType> input_types, Span<DataType> output_types);
-  void call(IndexMask mask, MFParams params, Context context) const override;
+  void call(IndexMask mask, Params params, Context context) const override;
 };
 
 class CustomMF_GenericCopy : public MultiFunction {
@@ -714,7 +714,7 @@ class CustomMF_GenericCopy : public MultiFunction {
 
  public:
   CustomMF_GenericCopy(DataType data_type);
-  void call(IndexMask mask, MFParams params, Context context) const override;
+  void call(IndexMask mask, Params params, Context context) const override;
 };
 
 }  // namespace blender::fn::multi_function
diff --git a/source/blender/functions/FN_multi_function_param_type.hh b/source/blender/functions/FN_multi_function_param_type.hh
index a80e7f7ebd9..147adb81718 100644
--- a/source/blender/functions/FN_multi_function_param_type.hh
+++ b/source/blender/functions/FN_multi_function_param_type.hh
@@ -31,7 +31,7 @@ enum class ParamCategory {
   VectorMutable,
 };
 
-template<ParamCategory Category, typename T> struct MFParamTag {
+template<ParamCategory Category, typename T> struct ParamTag {
   static constexpr ParamCategory category = Category;
   using base_type = T;
 };
diff --git a/source/blender/functions/FN_multi_function_params.hh b/source/blender/functions/FN_multi_function_params.hh
index 8f176b36a19..98e03760d47 100644
--- a/source/blender/functions/FN_multi_function_params.hh
+++ b/source/blender/functions/FN_multi_function_params.hh
@@ -5,10 +5,10 @@
 /** \file
  * \ingroup fn
  *
- * This file provides an MFParams and ParamsBuilder structure.
+ * This file provides an Params and ParamsBuilder structure.
  *
  * `ParamsBuilder` is used by a function caller to be prepare all parameters that are passed into
- * the function. `MFParams` is then used inside the called function to access the parameters.
+ * the function. `Params` is then used inside the called function to access the parameters.
  */
 
 #include <mutex>
@@ -32,7 +32,7 @@ class ParamsBuilder {
   Vector<std::variant<GVArray, GMutableSpan, const GVVectorArray *, GVectorArray *>>
       actual_params_;
 
-  friend class MFParams;
+  friend class Params;
 
   ParamsBuilder(const Signature &signature, const IndexMask mask)
       : signature_(&signature), mask_(mask), min_array_size_(mask.min_array_size())
@@ -217,12 +217,12 @@ class ParamsBuilder {
   void add_unused_output_for_unsupporting_function(const CPPType &type);
 };
 
-class MFParams {
+class Params {
  private:
   ParamsBuilder *builder_;
 
  public:
-  MFParams(ParamsBuilder &builder) : builder_(&builder)
+  Params(ParamsBuilder &builder) : builder_(&builder)
   {
   }
 
diff --git a/source/blender/functions/FN_multi_function_procedure.hh b/source/blender/functions/FN_multi_function_procedure.hh
index b4bdbf37780..c33fdea811f 100644
--- a/source/blender/functions/FN_multi_function_procedure.hh
+++ b/source/blender/functions/FN_multi_function_procedure.hh
@@ -226,12 +226,12 @@ class ReturnInstruction : public Instruction {
 /**
  * Inputs and outputs of the entire procedure network.
  */
-struct MFParameter {
+struct Parameter {
   ParamType::InterfaceType type;
   Variable *variable;
 };
 
-struct ConstMFParameter {
+struct ConstParameter {
   ParamType::InterfaceType type;
   const Variable *variable;
 };
@@ -253,7 +253,7 @@ class Procedure : NonCopyable, NonMovable {
   Vector<DummyInstruction *> dummy_instructions_;
   Vector<ReturnInstruction *> return_instructions_;
   Vector<Variable *> variables_;
-  Vector<MFParameter> params_;
+  Vector<Parameter> params_;
   Vector<destruct_ptr<MultiFunction>> owned_functions_;
   Instruction *entry_ = nullptr;
 
@@ -271,7 +271,7 @@ class Procedure : NonCopyable, NonMovable {
   ReturnInstruction &new_return_instruction();
 
   void add_parameter(ParamType::InterfaceType interface_type, Variable &variable);
-  Span<ConstMFParameter> params() const;
+  Span<ConstParameter> params() const;
 
   template<typename T, typename... Args> const MultiFunction &construct_function(Args &&...args);
 
@@ -502,10 +502,10 @@ inline const Instruction 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list