mad
Description
Computes multiply-add.
Signature
/// Requires Capability Set 1: T mad<T>( T mvalue, T avalue, T bvalue) where T : __BuiltinFloatingPointType; /// Requires Capability Set 1: vector<T, N> mad<T, N:int>( vector<T, N> mvalue, vector<T, N> avalue, vector<T, N> bvalue) where T : __BuiltinFloatingPointType; /// Requires Capability Set 1: matrix<T, N, M> mad<T, N:int, M:int>( matrix<T, N, M> mvalue, matrix<T, N, M> avalue, matrix<T, N, M> bvalue) where T : __BuiltinFloatingPointType; /// Requires Capability Set 2: T mad<T>( T mvalue, T avalue, T bvalue) where T : __BuiltinIntegerType; /// Requires Capability Set 2: vector<T, N> mad<T, N:int>( vector<T, N> mvalue, vector<T, N> avalue, vector<T, N> bvalue) where T : __BuiltinIntegerType; /// Requires Capability Set 2: matrix<T, N, M> mad<T, N:int, M:int>( matrix<T, N, M> mvalue, matrix<T, N, M> avalue, matrix<T, N, M> bvalue) where T : __BuiltinIntegerType;
Generic Parameters
T: __BuiltinFloatingPointType
N : int
M : int
T: __BuiltinIntegerType
Parameters
mvalue : T
The multiplier.
avalue : T
The multiplicand.
bvalue : T
The addend.
mvalue : vector<T, N>
The multiplier.
avalue : vector<T, N>
The multiplicand.
bvalue : vector<T, N>
The addend.
mvalue : matrix<T, N, M>
The multiplier.
avalue : matrix<T, N, M>
The multiplicand.
bvalue : matrix<T, N, M>
The addend.
Return value
The result of mvalue*avalue+bvalue.
Availability and Requirements
Capability Set 1
Defined for the following targets:
hlsl
Available in all stages.
glsl
Available in all stages.
cpp
Available in all stages.
cuda
Available in all stages.
metal
Available in all stages.
spirv
Available in all stages.
Capability Set 2
Defined for the following targets:
hlsl
Available in all stages.
glsl
Available in all stages.
cpp
Available in all stages.
cuda
Available in all stages.
spirv
Available in all stages.