Skip to content

Commit 05bb72b

Browse files
feat(const_eval): impl. min
1 parent 224585e commit 05bb72b

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
@@ -957,6 +957,11 @@ impl<'a> ConstantEvaluator<'a> {
957957
Ok([e1.max(e2)])
958958
})
959959
}
960+
crate::MathFunction::Min => {
961+
component_wise_scalar!(self, span, [arg, arg1.unwrap()], |e1, e2| {
962+
Ok([e1.min(e2)])
963+
})
964+
}
960965
crate::MathFunction::Radians => {
961966
component_wise_float!(self, span, [arg], |e1| { Ok([e1.to_radians()]) })
962967
}

0 commit comments

Comments
 (0)