Skip to content

Commit ca4e365

Browse files
feat(naga): add naga::proc::overloads::utils::scalars
1 parent 804ce8d commit ca4e365

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

naga/src/proc/overloads/utils.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,25 @@ pub fn float_scalars() -> impl Iterator<Item = ir::Scalar> + Clone {
3434
.into_iter()
3535
}
3636

37+
/// Produce all [`ir::Scalar`]s.
38+
///
39+
/// Note that `*32` and `F16` must appear before other sizes; this is how we
40+
/// represent conversion rank.
41+
pub fn scalars() -> impl Iterator<Item = ir::Scalar> + Clone {
42+
[
43+
ir::Scalar::ABSTRACT_INT,
44+
ir::Scalar::ABSTRACT_FLOAT,
45+
ir::Scalar::I32,
46+
ir::Scalar::U32,
47+
ir::Scalar::F32,
48+
ir::Scalar::F16,
49+
ir::Scalar::I64,
50+
ir::Scalar::U64,
51+
ir::Scalar::F64,
52+
]
53+
.into_iter()
54+
}
55+
3756
/// Produce all the floating-point [`ir::Scalar`]s, but omit
3857
/// abstract types, for #7405.
3958
pub fn float_scalars_unimplemented_abstract() -> impl Iterator<Item = ir::Scalar> + Clone {

0 commit comments

Comments
 (0)