Skip to content

Commit

Permalink
cover InsertBits
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblandy committed Dec 29, 2024
1 parent 6ed3edb commit acd6a5c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions naga/src/proc/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -310,7 +310,7 @@ macro_rules! typeset {
scalars: scalar!($scalar),
}
);
( $scalar:ident ) => (
( $scalar:tt ) => (
TypeSet {
constructors: ConstructorSet::SCALAR,
scalars: scalar!($scalar),
Expand All @@ -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) };
}

Expand Down Expand Up @@ -378,6 +381,7 @@ impl crate::MathFunction {
Mf::Atan2 => b!((T, T) -> T where (T: (vecN or scalar<float>))),

Mf::Dot => b!((T, T) -> (scalar T) where (T: (vecN<numeric>))),
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.
Expand Down Expand Up @@ -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!(),
Expand Down

0 comments on commit acd6a5c

Please sign in to comment.