Skip to content

Commit 27f2d93

Browse files
feat(const_eval): impl. min
1 parent 7d41f29 commit 27f2d93

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Bottom level categories:
8181
- `log`
8282
- `log2`
8383
- `max`
84+
- `min`
8485
- `radians`
8586
- `reverseBits`
8687
- `sign`

naga/src/proc/constant_evaluator.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,11 @@ impl<'a> ConstantEvaluator<'a> {
961961
Ok([e1.max(e2)])
962962
})
963963
}
964+
crate::MathFunction::Min => {
965+
component_wise_scalar!(self, span, [arg, arg1.unwrap()], |e1, e2| {
966+
Ok([e1.min(e2)])
967+
})
968+
}
964969
crate::MathFunction::Radians => {
965970
component_wise_float!(self, span, [arg], |e1| { Ok([e1.to_radians()]) })
966971
}

0 commit comments

Comments
 (0)