Skip to content

Commit b5f6547

Browse files
authored
[naga] Exhaustively match MathFunction in the constant evaluator. (#7487)
1 parent a611f72 commit b5f6547

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

naga/src/proc/constant_evaluator.rs

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,9 +1308,43 @@ impl<'a> ConstantEvaluator<'a> {
13081308
// vector
13091309
crate::MathFunction::Cross => self.cross_product(arg, arg1.unwrap(), span),
13101310

1311-
fun => Err(ConstantEvaluatorError::NotImplemented(format!(
1312-
"{fun:?} built-in function"
1313-
))),
1311+
// unimplemented
1312+
crate::MathFunction::Atan2
1313+
| crate::MathFunction::Modf
1314+
| crate::MathFunction::Frexp
1315+
| crate::MathFunction::Ldexp
1316+
| crate::MathFunction::Dot
1317+
| crate::MathFunction::Outer
1318+
| crate::MathFunction::Distance
1319+
| crate::MathFunction::Length
1320+
| crate::MathFunction::Normalize
1321+
| crate::MathFunction::FaceForward
1322+
| crate::MathFunction::Reflect
1323+
| crate::MathFunction::Refract
1324+
| crate::MathFunction::Mix
1325+
| crate::MathFunction::SmoothStep
1326+
| crate::MathFunction::Inverse
1327+
| crate::MathFunction::Transpose
1328+
| crate::MathFunction::Determinant
1329+
| crate::MathFunction::QuantizeToF16
1330+
| crate::MathFunction::ExtractBits
1331+
| crate::MathFunction::InsertBits
1332+
| crate::MathFunction::Pack4x8snorm
1333+
| crate::MathFunction::Pack4x8unorm
1334+
| crate::MathFunction::Pack2x16snorm
1335+
| crate::MathFunction::Pack2x16unorm
1336+
| crate::MathFunction::Pack2x16float
1337+
| crate::MathFunction::Pack4xI8
1338+
| crate::MathFunction::Pack4xU8
1339+
| crate::MathFunction::Unpack4x8snorm
1340+
| crate::MathFunction::Unpack4x8unorm
1341+
| crate::MathFunction::Unpack2x16snorm
1342+
| crate::MathFunction::Unpack2x16unorm
1343+
| crate::MathFunction::Unpack2x16float
1344+
| crate::MathFunction::Unpack4xI8
1345+
| crate::MathFunction::Unpack4xU8 => Err(ConstantEvaluatorError::NotImplemented(
1346+
format!("{fun:?} built-in function"),
1347+
)),
13141348
}
13151349
}
13161350

0 commit comments

Comments
 (0)