-
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
glsl-out: Perform casts in int only math functions #1978
glsl-out: Perform casts in int only math functions #1978
Conversation
2fdc50b
to
850cb13
Compare
Can we add a test for this? |
@teoxoy done |
Behavior looks good; just a few things that I think would make the code easier to read. |
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.
Just marking this as "changes requested" per @teoxoy's comments, to make it easier to track status.
Some functions like abs only accept signed integers while naga's IR accepts both signed and unsigned integers, this wasn't accounted for in the glsl backend causing it to produce code that wouldn't type check. This commit addresses it by performing casts from uint to int of the function argument and then back from int to uint for the function return.
c470489
to
2cd5157
Compare
Thanks @teoxoy, could you please re-review? |
Thanks, @jimblandy; not sure what happened there; I didn't mean to review 4 times 😅 |
Some functions like abs only accept signed integers while naga's IR
accepts both signed and unsigned integers, this wasn't accounted for in
the glsl backend causing it to produce code that wouldn't type check.
This commit addresses it by performing casts from uint to int of the
function argument and then back from int to uint for the function
return.
closes #1968
Edit: found some problems that need to be fixed firstEdit2: Good to go now