Skip to content

Commit acdfc66

Browse files
feat(const_eval): impl. min
1 parent ec252d8 commit acdfc66

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
@@ -75,6 +75,7 @@ Bottom level categories:
7575
- `log`
7676
- `log2`
7777
- `max`
78+
- `min`
7879
- `radians`
7980
- `reverseBits`
8081
- `sign`

naga/src/proc/constant_evaluator.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,11 @@ impl<'a> ConstantEvaluator<'a> {
952952
Ok([e1.max(e2)])
953953
})
954954
}
955+
crate::MathFunction::Min => {
956+
component_wise_scalar!(self, span, [arg, arg1.unwrap()], |e1, e2| {
957+
Ok([e1.min(e2)])
958+
})
959+
}
955960
crate::MathFunction::Pow => {
956961
component_wise_float!(self, span, [arg, arg1.unwrap()], |e1, e2| {
957962
Ok([e1.powf(e2)])

0 commit comments

Comments
 (0)