diff --git a/naga/src/proc/builtins.rs b/naga/src/proc/builtins.rs index fe1c1c449a7..ea625f74019 100644 --- a/naga/src/proc/builtins.rs +++ b/naga/src/proc/builtins.rs @@ -298,7 +298,7 @@ macro_rules! where_clause { /// Nicer notation for [`TypeSet`] values. macro_rules! typeset { - ( ( vecN or scalar < $scalar:ident > ) ) => ( + ( ( vecN or scalar < $scalar:tt > ) ) => ( TypeSet { constructors: ConstructorSet::VECN.union(ConstructorSet::SCALAR), scalars: scalar!($scalar), @@ -310,7 +310,7 @@ macro_rules! typeset { scalars: scalar!($scalar), } ); - ( $scalar:ident ) => ( + ( $scalar:tt ) => ( TypeSet { constructors: ConstructorSet::SCALAR, scalars: scalar!($scalar), @@ -322,11 +322,14 @@ macro_rules! typeset { macro_rules! scalar { ( numeric ) => ( ScalarSet::NUMERIC ); ( float ) => ( ScalarSet::ANY_FLOAT ); + ( ( concrete integer ) ) => ( ScalarSet::CONCRETE_INTEGER ); + ( u32 ) => ( ScalarSet::UINT_32 ); } /// Nicer notation for [`ReturnType`] values. macro_rules! return_type { ( T ) => { ReturnType::Match(0) }; + ( S ) => { ReturnType::Match(1) }; ( ( scalar T ) ) => { ReturnType::MatchScalar(0) }; } @@ -378,6 +381,7 @@ impl crate::MathFunction { Mf::Atan2 => b!((T, T) -> T where (T: (vecN or scalar))), Mf::Dot => b!((T, T) -> (scalar T) where (T: (vecN))), + Mf::InsertBits => b!((T, T, S, S) -> S where (T: (vecN or scalar<(concrete integer)>), S: u32)), /* // Functions of three floating-point arguments, extended // element-wise to vectors. @@ -426,7 +430,6 @@ impl crate::MathFunction { Mf::FaceForward => todo!(), Mf::Fma => todo!(), Mf::Frexp => todo!(), - Mf::InsertBits => todo!(), Mf::Inverse => todo!(), Mf::Ldexp => todo!(), Mf::Mix => todo!(),