Skip to content

Commit

Permalink
chore: satisfy clippy::collapsible_match
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Aug 12, 2024
1 parent 9dea058 commit 3aa12e9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
15 changes: 7 additions & 8 deletions naga/src/back/glsl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1313,14 +1313,13 @@ impl<'a, W: Write> Writer<'a, W> {
crate::MathFunction::Dot => {
// if the expression is a Dot product with integer arguments,
// then the args needs baking as well
if let TypeInner::Scalar(crate::Scalar { kind, .. }) = *inner {
match kind {
crate::ScalarKind::Sint | crate::ScalarKind::Uint => {
self.need_bake_expressions.insert(arg);
self.need_bake_expressions.insert(arg1.unwrap());
}
_ => {}
}
if let TypeInner::Scalar(crate::Scalar {
kind: crate::ScalarKind::Sint | crate::ScalarKind::Uint,
..
}) = *inner
{
self.need_bake_expressions.insert(arg);
self.need_bake_expressions.insert(arg1.unwrap());
}
}
crate::MathFunction::Pack4xI8
Expand Down
7 changes: 3 additions & 4 deletions naga/src/valid/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,15 +593,14 @@ impl FunctionInfo {
E::FunctionArgument(index) => {
let arg = &resolve_context.arguments[index as usize];
let uniform = match arg.binding {
Some(crate::Binding::BuiltIn(built_in)) => match built_in {
Some(crate::Binding::BuiltIn(
// per-polygon built-ins are uniform
crate::BuiltIn::FrontFacing
// per-work-group built-ins are uniform
| crate::BuiltIn::WorkGroupId
| crate::BuiltIn::WorkGroupSize
| crate::BuiltIn::NumWorkGroups => true,
_ => false,
},
| crate::BuiltIn::NumWorkGroups)
) => true,
// only flat inputs are uniform
Some(crate::Binding::Location {
interpolation: Some(crate::Interpolation::Flat),
Expand Down
7 changes: 3 additions & 4 deletions naga/src/valid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,14 +533,13 @@ impl Validator {

let decl_ty = &gctx.types[o.ty].inner;
match decl_ty {
&crate::TypeInner::Scalar(scalar) => match scalar {
&crate::TypeInner::Scalar(
crate::Scalar::BOOL
| crate::Scalar::I32
| crate::Scalar::U32
| crate::Scalar::F32
| crate::Scalar::F64 => {}
_ => return Err(OverrideError::TypeNotScalar),
},
| crate::Scalar::F64,
) => {}
_ => return Err(OverrideError::TypeNotScalar),
}

Expand Down

0 comments on commit 3aa12e9

Please sign in to comment.