-
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
Parenthesize unary negations to avoid --
#2087
Conversation
The failures in CI seem orthogonal to the changes in this PR, but I'm not sure. @jimblandy, @teoxoy, do you have any ideas? |
Both MSL and HLSL seem to complain about I'd say we wrap negations in parentheses instead of relying on spaces since we already seem to do that in the WGSL backend. |
@teoxoy: Ah, okay, I obviously didn't cut through the other (unrelated?) warnings well enough to get to the errors you mention. Yep, that seems expected until we actually fix the offending cases. Sorry for the noise. 😅 |
No worries; yeah I always have to search for "error" in the CI terminal output. |
I do think that parentheses are going to be the simplest cross-target way of disambiguating operations. It will also be easier to intuit as a solution than spacing overall for both consumers and maintainers. @jimblandy, @teoxoy: Any objection to me switching this (and other negation fixes, like for #2088) PR to use parentheses, instead of spacing? (Is there a reason you may not have done this in the first place, @kvark?) |
0a8b672
to
55fbfc5
Compare
--
9c99c00
to
38b181b
Compare
--
--
This PR is now ready to go, I think, except for the upstream
EDIT: Tested my hypothesis at (1). |
@jimblandy: I know that #1565 was originally marked as Also, can we close the old PR, since we've already determined that it's not the direction we want? CC @kvark, @teoxoy. |
We can take a dependency on the git version of rspirv until they get around to releasing it. Next naga release is January 4th, so they have (exactly) two months. |
I'm not an owner of |
…sl` everywhere Unify parenthesization of unary negations across all backends with what the `wgsl` backend does, which is `<op>(<expr>)`. This avoids ambiguity with output languages for which `--` is a different operation; in this case, we've been accidentally emitting prefix decrements.
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.
Looks great!
Fixes #1564 and #2088. Most of the diff is snapshot test changes, have no fear!
Supersedes @kvark's PR at #1565, with major differences:
master
.git
dependency for now (thanks for the pointer, @teoxoy!). This should be easy tofixup!
once upstream actually releases (presumablyrspirv
0.12?); here's a checkbox to track it:rspirv
it comes out. Proposing working around it. EDIT: Accepted, just go with the Git dep for now.glsl
backend for this issue, which was missed originally.Recommended review experience is commit-by-commit.