Cleanup: remove MF prefix from some classes in multi-function namespace
This was missing in rBeedcf1876a6651c38d8f4daa2e65d1fb81f77c5d.
This commit is contained in:
parent
8625495b1c
commit
50980981e3
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -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 *DummyInstruction::next() const
|
|||
/** \name #Procedure Inline Methods
|
||||
* \{ */
|
||||
|
||||
inline Span<ConstMFParameter> Procedure::params() const
|
||||
inline Span<ConstParameter> Procedure::params() const
|
||||
{
|
||||
static_assert(sizeof(MFParameter) == sizeof(ConstMFParameter));
|
||||
return params_.as_span().cast<ConstMFParameter>();
|
||||
static_assert(sizeof(Parameter) == sizeof(ConstParameter));
|
||||
return params_.as_span().cast<ConstParameter>();
|
||||
}
|
||||
|
||||
inline Instruction *Procedure::entry()
|
||||
|
|
|
@ -19,7 +19,7 @@ class ProcedureExecutor : public MultiFunction {
|
|||
public:
|
||||
ProcedureExecutor(const Procedure &procedure);
|
||||
|
||||
void call(IndexMask mask, MFParams params, Context context) const override;
|
||||
void call(IndexMask mask, Params params, Context context) const override;
|
||||
|
||||
private:
|
||||
ExecutionHints get_execution_hints() const override;
|
||||
|
|
|
@ -19,7 +19,7 @@ enum class ParamFlag {
|
|||
None = 0,
|
||||
/**
|
||||
* If set, the multi-function parameter can be accessed using
|
||||
* #MFParams::uninitialized_single_output_if_required which can result in better performance
|
||||
* #Params::uninitialized_single_output_if_required which can result in better performance
|
||||
* because the output does not have to be computed when it is not needed.
|
||||
*/
|
||||
SupportsUnusedOutput = 1 << 0,
|
||||
|
@ -142,7 +142,7 @@ class SignatureBuilder {
|
|||
}
|
||||
|
||||
template<ParamCategory Category, typename T>
|
||||
void add(MFParamTag<Category, T> /* tag */, const char *name)
|
||||
void add(ParamTag<Category, T> /* tag */, const char *name)
|
||||
{
|
||||
switch (Category) {
|
||||
case ParamCategory::SingleInput:
|
||||
|
|
|
@ -52,7 +52,7 @@ static int64_t compute_grain_size(const ExecutionHints &hints, const IndexMask m
|
|||
return grain_size;
|
||||
}
|
||||
|
||||
void MultiFunction::call_auto(IndexMask mask, MFParams params, Context context) const
|
||||
void MultiFunction::call_auto(IndexMask mask, Params params, Context context) const
|
||||
{
|
||||
if (mask.is_empty()) {
|
||||
return;
|
||||
|
|
|
@ -31,7 +31,7 @@ CustomMF_GenericConstant::~CustomMF_GenericConstant()
|
|||
}
|
||||
}
|
||||
|
||||
void CustomMF_GenericConstant::call(IndexMask mask, MFParams params, Context /*context*/) const
|
||||
void CustomMF_GenericConstant::call(IndexMask mask, Params params, Context /*context*/) const
|
||||
{
|
||||
GMutableSpan output = params.uninitialized_single_output(0);
|
||||
type_.fill_construct_indices(value_, output.data(), mask);
|
||||
|
@ -62,9 +62,7 @@ CustomMF_GenericConstantArray::CustomMF_GenericConstantArray(GSpan array) : arra
|
|||
this->set_signature(&signature_);
|
||||
}
|
||||
|
||||
void CustomMF_GenericConstantArray::call(IndexMask mask,
|
||||
MFParams params,
|
||||
Context /*context*/) const
|
||||
void CustomMF_GenericConstantArray::call(IndexMask mask, Params params, Context /*context*/) const
|
||||
{
|
||||
GVectorArray &vectors = params.vector_output(0);
|
||||
for (int64_t i : mask) {
|
||||
|
@ -85,7 +83,7 @@ CustomMF_DefaultOutput::CustomMF_DefaultOutput(Span<DataType> input_types,
|
|||
}
|
||||
this->set_signature(&signature_);
|
||||
}
|
||||
void CustomMF_DefaultOutput::call(IndexMask mask, MFParams params, Context /*context*/) const
|
||||
void CustomMF_DefaultOutput::call(IndexMask mask, Params params, Context /*context*/) const
|
||||
{
|
||||
for (int param_index : this->param_indices()) {
|
||||
ParamType param_type = this->param_type(param_index);
|
||||
|
@ -109,7 +107,7 @@ CustomMF_GenericCopy::CustomMF_GenericCopy(DataType data_type)
|
|||
this->set_signature(&signature_);
|
||||
}
|
||||
|
||||
void CustomMF_GenericCopy::call(IndexMask mask, MFParams params, Context /*context*/) const
|
||||
void CustomMF_GenericCopy::call(IndexMask mask, Params params, Context /*context*/) const
|
||||
{
|
||||
const DataType data_type = this->param_type(0).data_type();
|
||||
switch (data_type.category()) {
|
||||
|
|
|
@ -373,7 +373,7 @@ bool Procedure::validate_same_variables_in_one_call() const
|
|||
bool Procedure::validate_parameters() const
|
||||
{
|
||||
Set<const Variable *> variables;
|
||||
for (const MFParameter ¶m : params_) {
|
||||
for (const Parameter ¶m : params_) {
|
||||
/* One variable cannot be used as multiple parameters. */
|
||||
if (!variables.add(param.variable)) {
|
||||
return false;
|
||||
|
@ -430,7 +430,7 @@ bool Procedure::validate_initialization() const
|
|||
}
|
||||
}
|
||||
Set<const Variable *> variables_that_should_be_initialized_on_return;
|
||||
for (const MFParameter ¶m : params_) {
|
||||
for (const Parameter ¶m : params_) {
|
||||
if (ELEM(param.type, ParamType::Mutable, ParamType::Output)) {
|
||||
variables_that_should_be_initialized_on_return.add_new(param.variable);
|
||||
}
|
||||
|
@ -461,7 +461,7 @@ Procedure::InitState Procedure::find_initialization_state_before_instruction(
|
|||
|
||||
auto check_entry_instruction = [&]() {
|
||||
bool caller_initialized_variable = false;
|
||||
for (const MFParameter ¶m : params_) {
|
||||
for (const Parameter ¶m : params_) {
|
||||
if (param.variable == &target_variable) {
|
||||
if (ELEM(param.type, ParamType::Input, ParamType::Mutable)) {
|
||||
caller_initialized_variable = true;
|
||||
|
@ -810,14 +810,14 @@ class ProcedureDotExport {
|
|||
{
|
||||
instruction_name_format("Return ", ss);
|
||||
|
||||
Vector<ConstMFParameter> outgoing_parameters;
|
||||
for (const ConstMFParameter ¶m : procedure_.params()) {
|
||||
Vector<ConstParameter> outgoing_parameters;
|
||||
for (const ConstParameter ¶m : procedure_.params()) {
|
||||
if (ELEM(param.type, ParamType::Mutable, ParamType::Output)) {
|
||||
outgoing_parameters.append(param);
|
||||
}
|
||||
}
|
||||
for (const int param_index : outgoing_parameters.index_range()) {
|
||||
const ConstMFParameter ¶m = outgoing_parameters[param_index];
|
||||
const ConstParameter ¶m = outgoing_parameters[param_index];
|
||||
variable_to_string(param.variable, ss);
|
||||
if (param_index < outgoing_parameters.size() - 1) {
|
||||
ss << ", ";
|
||||
|
@ -835,14 +835,14 @@ class ProcedureDotExport {
|
|||
{
|
||||
std::stringstream ss;
|
||||
ss << "Entry: ";
|
||||
Vector<ConstMFParameter> incoming_parameters;
|
||||
for (const ConstMFParameter ¶m : procedure_.params()) {
|
||||
Vector<ConstParameter> incoming_parameters;
|
||||
for (const ConstParameter ¶m : procedure_.params()) {
|
||||
if (ELEM(param.type, ParamType::Input, ParamType::Mutable)) {
|
||||
incoming_parameters.append(param);
|
||||
}
|
||||
}
|
||||
for (const int param_index : incoming_parameters.index_range()) {
|
||||
const ConstMFParameter ¶m = incoming_parameters[param_index];
|
||||
const ConstParameter ¶m = incoming_parameters[param_index];
|
||||
variable_to_string(param.variable, ss);
|
||||
if (param_index < incoming_parameters.size() - 1) {
|
||||
ss << ", ";
|
||||
|
|
|
@ -10,7 +10,7 @@ ProcedureExecutor::ProcedureExecutor(const Procedure &procedure) : procedure_(pr
|
|||
{
|
||||
SignatureBuilder builder("Procedure Executor", signature_);
|
||||
|
||||
for (const ConstMFParameter ¶m : procedure.params()) {
|
||||
for (const ConstParameter ¶m : procedure.params()) {
|
||||
builder.add("Parameter", ParamType(param.type, param.variable->data_type()));
|
||||
}
|
||||
|
||||
|
@ -861,7 +861,7 @@ class VariableStates {
|
|||
|
||||
void add_initial_variable_states(const ProcedureExecutor &fn,
|
||||
const Procedure &procedure,
|
||||
MFParams ¶ms)
|
||||
Params ¶ms)
|
||||
{
|
||||
for (const int param_index : fn.param_indices()) {
|
||||
ParamType param_type = fn.param_type(param_index);
|
||||
|
@ -1169,7 +1169,7 @@ class InstructionScheduler {
|
|||
}
|
||||
};
|
||||
|
||||
void ProcedureExecutor::call(IndexMask full_mask, MFParams params, Context context) const
|
||||
void ProcedureExecutor::call(IndexMask full_mask, Params params, Context context) const
|
||||
{
|
||||
BLI_assert(procedure_.validate());
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ class TwoOutputFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature_);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<int> &in1 = params.readonly_single_input<int>(0, "In1");
|
||||
const VArray<int> &in2 = params.readonly_single_input<int>(1, "In2");
|
||||
|
|
|
@ -24,7 +24,7 @@ class AddFunction : 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
|
||||
{
|
||||
const VArray<int> &a = params.readonly_single_input<int>(0, "A");
|
||||
const VArray<int> &b = params.readonly_single_input<int>(1, "B");
|
||||
|
|
|
@ -18,7 +18,7 @@ class AddPrefixFunction : 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
|
||||
{
|
||||
const VArray<std::string> &prefixes = params.readonly_single_input<std::string>(0, "Prefix");
|
||||
MutableSpan<std::string> strings = params.single_mutable<std::string>(1, "Strings");
|
||||
|
@ -43,7 +43,7 @@ class CreateRangeFunction : 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
|
||||
{
|
||||
const VArray<int> &sizes = params.readonly_single_input<int>(0, "Size");
|
||||
GVectorArray &ranges = params.vector_output(1, "Range");
|
||||
|
@ -70,7 +70,7 @@ class GenericAppendFunction : 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
|
||||
{
|
||||
GVectorArray &vectors = params.vector_mutable(0, "Vector");
|
||||
const GVArray &values = params.readonly_single_input(1, "Value");
|
||||
|
@ -98,7 +98,7 @@ class ConcatVectorsFunction : 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
|
||||
{
|
||||
GVectorArray &a = params.vector_mutable(0);
|
||||
const GVVectorArray &b = params.readonly_vector_input(1);
|
||||
|
@ -120,7 +120,7 @@ class AppendFunction : 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
|
||||
{
|
||||
GVectorArray_TypedMutableRef<int> vectors = params.vector_mutable<int>(0);
|
||||
const VArray<int> &values = params.readonly_single_input<int>(1);
|
||||
|
@ -145,7 +145,7 @@ class SumVectorFunction : 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
|
||||
{
|
||||
const VVectorArray<int> &vectors = params.readonly_vector_input<int>(0);
|
||||
MutableSpan<int> sums = params.uninitialized_single_output<int>(1);
|
||||
|
@ -174,7 +174,7 @@ class OptionalOutputsFunction : 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
|
||||
{
|
||||
if (params.single_output_is_required(0, "Out 1")) {
|
||||
MutableSpan<int> values = params.uninitialized_single_output<int>(0, "Out 1");
|
||||
|
|
|
@ -154,7 +154,7 @@ class MF_AlignEulerToVector : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float3> &input_rotations = params.readonly_single_input<float3>(0, "Rotation");
|
||||
const VArray<float> &factors = params.readonly_single_input<float>(1, "Factor");
|
||||
|
|
|
@ -24,7 +24,7 @@ class MF_SpecialCharacters : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
MutableSpan<std::string> lb = params.uninitialized_single_output<std::string>(0, "Line Break");
|
||||
MutableSpan<std::string> tab = params.uninitialized_single_output<std::string>(1, "Tab");
|
||||
|
|
|
@ -54,7 +54,7 @@ class SeparateRGBAFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<ColorGeometry4f> &colors = params.readonly_single_input<ColorGeometry4f>(0,
|
||||
"Color");
|
||||
|
@ -113,7 +113,7 @@ class SeparateHSVAFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<ColorGeometry4f> &colors = params.readonly_single_input<ColorGeometry4f>(0,
|
||||
"Color");
|
||||
|
@ -151,7 +151,7 @@ class SeparateHSLAFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<ColorGeometry4f> &colors = params.readonly_single_input<ColorGeometry4f>(0,
|
||||
"Color");
|
||||
|
|
|
@ -223,7 +223,7 @@ class SampleFloatSegmentsFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArraySpan<float> lengths = params.readonly_single_input<float>(0, "Length");
|
||||
MutableSpan<int> indices = params.uninitialized_single_output<int>(1, "Curve Index");
|
||||
|
@ -270,7 +270,7 @@ class SampleCurveFunction : public mf::MultiFunction {
|
|||
this->evaluate_source();
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
MutableSpan<float3> sampled_positions = params.uninitialized_single_output_if_required<float3>(
|
||||
2, "Position");
|
||||
|
|
|
@ -316,7 +316,7 @@ class ImageFieldsFunction : public mf::MultiFunction {
|
|||
}
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float3> &vectors = params.readonly_single_input<float3>(0, "Vector");
|
||||
MutableSpan<ColorGeometry4f> r_color = params.uninitialized_single_output<ColorGeometry4f>(
|
||||
|
|
|
@ -149,7 +149,7 @@ class ProximityFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float3> &src_positions = params.readonly_single_input<float3>(0,
|
||||
"Source Position");
|
||||
|
|
|
@ -241,7 +241,7 @@ class RaycastFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature_);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
/* Hit positions are always necessary for retrieving the attribute from the target if that
|
||||
* output is required, so always retrieve a span from the evaluator in that case (it's
|
||||
|
|
|
@ -222,7 +222,7 @@ class SampleIndexFunction : public mf::MultiFunction {
|
|||
src_data_ = &evaluator_->get_evaluated(0);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<int> &indices = params.readonly_single_input<int>(0, "Index");
|
||||
GMutableSpan dst = params.uninitialized_single_output(1, "Value");
|
||||
|
|
|
@ -252,7 +252,7 @@ class SampleNearestFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature_);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float3> &positions = params.readonly_single_input<float3>(0, "Position");
|
||||
MutableSpan<int> indices = params.uninitialized_single_output<int>(1, "Index");
|
||||
|
|
|
@ -147,7 +147,7 @@ class SampleNearestSurfaceFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature_);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float3> &positions = params.readonly_single_input<float3>(0, "Position");
|
||||
GMutableSpan dst = params.uninitialized_single_output_if_required(1, "Value");
|
||||
|
|
|
@ -138,7 +138,7 @@ class SampleMeshBarycentricFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature_);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArraySpan<int> triangle_indices = params.readonly_single_input<int>(0,
|
||||
"Triangle Index");
|
||||
|
@ -208,7 +208,7 @@ class ReverseUVSampleFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArraySpan<float2> sample_uvs = params.readonly_single_input<float2>(0, "Sample UV");
|
||||
MutableSpan<bool> is_valid = params.uninitialized_single_output_if_required<bool>(1,
|
||||
|
|
|
@ -105,7 +105,7 @@ class ColorBandFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float> &values = params.readonly_single_input<float>(0, "Value");
|
||||
MutableSpan<ColorGeometry4f> colors = params.uninitialized_single_output<ColorGeometry4f>(
|
||||
|
|
|
@ -81,7 +81,7 @@ class CurveVecFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float> &fac = params.readonly_single_input<float>(0, "Fac");
|
||||
const VArray<float3> &vec_in = params.readonly_single_input<float3>(1, "Vector");
|
||||
|
@ -224,7 +224,7 @@ class CurveRGBFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float> &fac = params.readonly_single_input<float>(0, "Fac");
|
||||
const VArray<ColorGeometry4f> &col_in = params.readonly_single_input<ColorGeometry4f>(1,
|
||||
|
@ -344,7 +344,7 @@ class CurveFloatFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float> &fac = params.readonly_single_input<float>(0, "Factor");
|
||||
const VArray<float> &val_in = params.readonly_single_input<float>(1, "Value");
|
||||
|
|
|
@ -150,7 +150,7 @@ class ClampWrapperFunction : public mf::MultiFunction {
|
|||
this->set_signature(&fn.signature());
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context context) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context context) const override
|
||||
{
|
||||
fn_.call(mask, params, context);
|
||||
|
||||
|
|
|
@ -373,7 +373,7 @@ class MixColorFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float> &fac = params.readonly_single_input<float>(0, "Factor");
|
||||
const VArray<ColorGeometry4f> &col1 = params.readonly_single_input<ColorGeometry4f>(1, "A");
|
||||
|
|
|
@ -111,7 +111,7 @@ class MixRGBFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float> &fac = params.readonly_single_input<float>(0, "Fac");
|
||||
const VArray<ColorGeometry4f> &col1 = params.readonly_single_input<ColorGeometry4f>(1,
|
||||
|
|
|
@ -43,7 +43,7 @@ class SeparateRGBFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<ColorGeometry4f> &colors = params.readonly_single_input<ColorGeometry4f>(0,
|
||||
"Color");
|
||||
|
|
|
@ -43,7 +43,7 @@ class MF_SeparateXYZ : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float3> &vectors = params.readonly_single_input<float3>(0, "XYZ");
|
||||
MutableSpan<float> xs = params.uninitialized_single_output_if_required<float>(1, "X");
|
||||
|
|
|
@ -201,7 +201,7 @@ class BrickFunction : public mf::MultiFunction {
|
|||
return float2(tint, mortar);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float3> &vector = params.readonly_single_input<float3>(0, "Vector");
|
||||
const VArray<ColorGeometry4f> &color1_values = params.readonly_single_input<ColorGeometry4f>(
|
||||
|
|
|
@ -62,7 +62,7 @@ class NodeTexChecker : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float3> &vector = params.readonly_single_input<float3>(0, "Vector");
|
||||
const VArray<ColorGeometry4f> &color1 = params.readonly_single_input<ColorGeometry4f>(
|
||||
|
|
|
@ -65,7 +65,7 @@ class GradientFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float3> &vector = params.readonly_single_input<float3>(0, "Vector");
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class MagicFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float3> &vector = params.readonly_single_input<float3>(0, "Vector");
|
||||
const VArray<float> &scale = params.readonly_single_input<float>(1, "Scale");
|
||||
|
|
|
@ -195,7 +195,7 @@ class MusgraveFunction : public mf::MultiFunction {
|
|||
return signature;
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
auto get_vector = [&](int param_index) -> VArray<float3> {
|
||||
return params.readonly_single_input<float3>(param_index, "Vector");
|
||||
|
|
|
@ -121,7 +121,7 @@ class NoiseFunction : public mf::MultiFunction {
|
|||
return signature;
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
int param = ELEM(dimensions_, 2, 3, 4) + ELEM(dimensions_, 1, 4);
|
||||
const VArray<float> &scale = params.readonly_single_input<float>(param++, "Scale");
|
||||
|
|
|
@ -237,7 +237,7 @@ class VoronoiMinowskiFunction : public mf::MultiFunction {
|
|||
return signature;
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
auto get_vector = [&](int param_index) -> VArray<float3> {
|
||||
return params.readonly_single_input<float3>(param_index, "Vector");
|
||||
|
@ -674,7 +674,7 @@ class VoronoiMetricFunction : public mf::MultiFunction {
|
|||
return signature;
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
auto get_vector = [&](int param_index) -> VArray<float3> {
|
||||
return params.readonly_single_input<float3>(param_index, "Vector");
|
||||
|
@ -1182,7 +1182,7 @@ class VoronoiEdgeFunction : public mf::MultiFunction {
|
|||
return signature;
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
auto get_vector = [&](int param_index) -> VArray<float3> {
|
||||
return params.readonly_single_input<float3>(param_index, "Vector");
|
||||
|
|
|
@ -111,7 +111,7 @@ class WaveFunction : public mf::MultiFunction {
|
|||
this->set_signature(&signature);
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
const VArray<float3> &vector = params.readonly_single_input<float3>(0, "Vector");
|
||||
const VArray<float> &scale = params.readonly_single_input<float>(1, "Scale");
|
||||
|
|
|
@ -98,7 +98,7 @@ class WhiteNoiseFunction : public mf::MultiFunction {
|
|||
return signature;
|
||||
}
|
||||
|
||||
void call(IndexMask mask, mf::MFParams params, mf::Context /*context*/) const override
|
||||
void call(IndexMask mask, mf::Params params, mf::Context /*context*/) const override
|
||||
{
|
||||
int param = ELEM(dimensions_, 2, 3, 4) + ELEM(dimensions_, 1, 4);
|
||||
|
||||
|
|
Loading…
Reference in New Issue