naga::proc::overloads::regular

Macro regular

Source
macro_rules! regular {
    ( $arity:literal , $( $constr:ident )|* of $( $scalar:ident )|*) => { ... };
    ( $arity:literal , $( $constr:ident )|* of $( $scalar:ident )|* -> $conclude:ident) => { ... };
}
Expand description

Construct a Regular OverloadSet.

Examples:

  • regular!(2, SCALAR|VECN of FLOAT): An overload set whose rules take two arguments of the same type: a floating-point scalar (possibly abstract) or a vector of such. The return type is the same as the argument type.

  • regular!(1, VECN of FLOAT -> Scalar): An overload set whose rules take one argument that is a vector of floats, and whose return type is the leaf scalar type of the argument type.

The constructor values (before the < angle brackets >) are constants from ConstructorSet.

The scalar values (inside the < angle brackets >) are constants from ScalarSet.

When a return type identifier is given, it is treated as a variant of the the ConclusionRule enum.