mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 00:03:29 +00:00
refactor(naga): split out cross
handling to separate match
arm
This commit is contained in:
parent
7164f3eb4e
commit
0ce5996891
@ -1161,7 +1161,7 @@ impl super::Validator {
|
||||
));
|
||||
}
|
||||
}
|
||||
Mf::Outer | Mf::Cross | Mf::Reflect => {
|
||||
Mf::Outer | Mf::Reflect => {
|
||||
let arg1_ty = match (arg1_ty, arg2_ty, arg3_ty) {
|
||||
(Some(ty1), None, None) => ty1,
|
||||
_ => return Err(ExpressionError::WrongArgumentCount(fun)),
|
||||
@ -1172,8 +1172,31 @@ impl super::Validator {
|
||||
Sc {
|
||||
kind: Sk::Float, ..
|
||||
},
|
||||
size: vector_size,
|
||||
} if fun != Mf::Cross || vector_size == crate::VectorSize::Tri => {}
|
||||
..
|
||||
} => {}
|
||||
_ => return Err(ExpressionError::InvalidArgumentType(fun, 0, arg)),
|
||||
}
|
||||
if arg1_ty != arg_ty {
|
||||
return Err(ExpressionError::InvalidArgumentType(
|
||||
fun,
|
||||
1,
|
||||
arg1.unwrap(),
|
||||
));
|
||||
}
|
||||
}
|
||||
Mf::Cross => {
|
||||
let arg1_ty = match (arg1_ty, arg2_ty, arg3_ty) {
|
||||
(Some(ty1), None, None) => ty1,
|
||||
_ => return Err(ExpressionError::WrongArgumentCount(fun)),
|
||||
};
|
||||
match *arg_ty {
|
||||
Ti::Vector {
|
||||
scalar:
|
||||
Sc {
|
||||
kind: Sk::Float, ..
|
||||
},
|
||||
size: crate::VectorSize::Tri,
|
||||
} => {}
|
||||
_ => return Err(ExpressionError::InvalidArgumentType(fun, 0, arg)),
|
||||
}
|
||||
if arg1_ty != arg_ty {
|
||||
|
Loading…
Reference in New Issue
Block a user