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

Disallow taking the address of a handle #1983

Merged
merged 2 commits into from Jul 27, 2021

Conversation

alan-baker
Copy link
Contributor

Fixes #1832

@alan-baker alan-baker added the wgsl WebGPU Shading Language Issues label Jul 23, 2021
@alan-baker alan-baker requested review from kvark and dneto0 July 23, 2021 14:23
@alan-baker alan-baker added the wgsl resolved Resolved - waiting for a change to the WGSL specification label Jul 23, 2021
@github-actions
Copy link
Contributor

Previews, as seen when this build job started (cff61c9):
WebGPU | IDL
WGSL
Explainer

wgsl/index.bs Outdated
@@ -4511,6 +4511,9 @@ The <dfn noexport>address-of</dfn> operator converts a reference to its correspo
If |r| is an [=invalid memory reference=], then the resulting
pointer is also an invalid memory reference.

It is a [=shader-creation error=] if |T| is type stored in the
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it simpler to say |SC| must not be handle ?

And in https://gpuweb.github.io/gpuweb/wgsl/#module-scope-variables it says

If the store type is a texture type or a sampler type, then the variable declaration must not have a storage class decoration. The storage class will always be handle.

(In any case, I think the proposed text is missing "a", as in "is a type stored in the...")

Copy link
Contributor

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

Thanks!

@dneto0 dneto0 merged commit f5aeea2 into gpuweb:main Jul 27, 2021
github-actions bot added a commit that referenced this pull request Jul 27, 2021
SHA: f5aeea2
Reason: push, by @dneto0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Jul 27, 2021
SHA: f5aeea2
Reason: push, by @dneto0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Jul 27, 2021
SHA: f5aeea2
Reason: push, by @dneto0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wgsl resolved Resolved - waiting for a change to the WGSL specification wgsl WebGPU Shading Language Issues
Projects
WGSL
Awaiting triage
Development

Successfully merging this pull request may close these issues.

We should forbid pointers to handles
3 participants