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
Remove requirement that function / builtin return values are always consumed #2138
Comments
I proposed the original rule, as a way to add guardrails to the language. If those guardrails are bothersome, then I'm ok removing the rule. |
dneto0
added a commit
to dneto0/gpuweb
that referenced
this issue
Sep 28, 2021
Also, define "return value", and cross-reference to it. Fixes: gpuweb#2138
dneto0
added a commit
that referenced
this issue
Sep 29, 2021
Also, define "return value", and cross-reference to it. Fixes: #2138
WGSL meeting minutes 2021-09-28
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background:
#1413 proposed that call statements may only call a function or builtin with no return value, and that call expressions must be consumed by a statement. #1651 introduced this rule with the line:
ignore()
was added in #1587, and its original use was to allow an "escape-hatch" for cases where the user needs to call a function that returns a value, and doesn't actually want to use that returned value.Since
ignore()
was added to the spec, it has found additional use for ensuring that binding points are referenced by a given entry point (this is possibly a Tint <-> Dawn implementation detail that needs spec clarification).In #2115 we're discussing replacing
ignore()
with_
.We're now getting feedback 1 from users that this original rule may be too restrictive.
For example: it's common to want to call
atomicAdd()
without using the returned "old" value.I'm filing this issue so we can re-evaluate whether the rule to always consume a call return value is worth keeping.
The text was updated successfully, but these errors were encountered: