Skip to content
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

Merged
merged 6 commits into from
Aug 16, 2022
Merged

Saturate #2025

merged 6 commits into from
Aug 16, 2022

Conversation

evahop
Copy link
Contributor

@evahop evahop commented Aug 11, 2022

Adds saturate and converts it to clamp(e, 0.0, 1.0) where necessary.

Copy link
Collaborator

@JCapucho JCapucho left a 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

src/proc/typifier.rs Show resolved Hide resolved
src/valid/expression.rs Outdated Show resolved Hide resolved
src/back/glsl/mod.rs Outdated Show resolved Hide resolved
src/back/glsl/mod.rs Outdated Show resolved Hide resolved
src/back/spv/block.rs Outdated Show resolved Hide resolved
@evahop evahop requested a review from JCapucho August 11, 2022 22:35
Copy link
Collaborator

@JCapucho JCapucho left a 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).

@evahop
Copy link
Contributor Author

evahop commented Aug 12, 2022

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 👀

@JCapucho
Copy link
Collaborator

Thanks for you work, I've gone ahead and rebased it so now it's ready to be merged

@JCapucho JCapucho enabled auto-merge (squash) August 16, 2022 10:42
@JCapucho JCapucho merged commit a80967f into gfx-rs:master Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants