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

Fix Integer Clamp #5300

Merged
merged 3 commits into from
Feb 26, 2024
Merged

Fix Integer Clamp #5300

merged 3 commits into from
Feb 26, 2024

Conversation

cwfitzgerald
Copy link
Member

Connections

Discovered during my work on #3159.

Description

clamp(3, 2, 1) for integers is explicitly defined by the wgsl spec as returning 1. In practice this happens on OpenGL on nvidia cards and on vulkan on AMD cards.

Testing

Have a PR coming up with tests for int clamp, as well as other shader functions

@cwfitzgerald cwfitzgerald requested a review from a team as a code owner February 25, 2024 08:35
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, interesting detail. Nothing is ever easy!

naga/src/back/glsl/mod.rs Show resolved Hide resolved
@Wumpf
Copy link
Member

Wumpf commented Feb 25, 2024

warrants a changelog entry imho

@Wumpf Wumpf merged commit 38419a9 into gfx-rs:trunk Feb 26, 2024
27 checks passed
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.

3 participants