mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-28 17:53:40 +00:00
chore: satisfy clippy::collapsible_match
This commit is contained in:
parent
8231d31eab
commit
5533c37786
@ -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
|
||||
|
@ -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),
|
||||
|
@ -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),
|
||||
}
|
||||
|
||||
|
@ -49,18 +49,19 @@ fn main() {
|
||||
|
||||
match event {
|
||||
Event::LoopDestroyed => (),
|
||||
Event::WindowEvent { event, .. } => match event {
|
||||
WindowEvent::CloseRequested
|
||||
| WindowEvent::KeyboardInput {
|
||||
input:
|
||||
KeyboardInput {
|
||||
virtual_keycode: Some(VirtualKeyCode::Escape),
|
||||
..
|
||||
},
|
||||
..
|
||||
} => *control_flow = ControlFlow::Exit,
|
||||
_ => (),
|
||||
},
|
||||
Event::WindowEvent {
|
||||
event:
|
||||
WindowEvent::CloseRequested
|
||||
| WindowEvent::KeyboardInput {
|
||||
input:
|
||||
KeyboardInput {
|
||||
virtual_keycode: Some(VirtualKeyCode::Escape),
|
||||
..
|
||||
},
|
||||
..
|
||||
},
|
||||
..
|
||||
} => *control_flow = ControlFlow::Exit,
|
||||
_ => (),
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user