Skip to content

Commit

Permalink
feat(const_eval): impl. trunc
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Jan 19, 2024
1 parent 2819927 commit c4df992
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Bottom level categories:
- `radians`
- `reverseBits`
- `sign`
- `trunc`

## v0.19.0 (2024-01-17)

Expand Down
3 changes: 3 additions & 0 deletions naga/src/proc/constant_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,9 @@ impl<'a> ConstantEvaluator<'a> {
Ok([if edge <= x { 1.0 } else { 0.0 }])
})
}
crate::MathFunction::Trunc => {
component_wise_float!(self, span, [arg], |e| { Ok([e.trunc()]) })
}
fun => Err(ConstantEvaluatorError::NotImplemented(format!(
"{fun:?} built-in function"
))),
Expand Down

0 comments on commit c4df992

Please sign in to comment.