-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saturate #2025
Saturate #2025
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution, there are some problems with some parts of it and some code could be improved but overall it's on the right track.
You should add a test (math-functions.wgsl
seems like a good place).
Also the spec you point to is outdated, the newer version is at https://gpuweb.github.io/gpuweb/wgsl/#saturate-float-builtin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, everything looks great now, there seems to be problems with clippy not related to your changes, I'll fix them and then we can merge your PR (you might need to rebase).
Cool, I’ll be on the lookout 👀 |
Co-authored-by: João Capucho <jcapucho7@gmail.com>
Thanks for you work, I've gone ahead and rebased it so now it's ready to be merged |
Adds saturate and converts it to
clamp(e, 0.0, 1.0)
where necessary.