Skip to content

wgsl: Disallow taking the address of a vector component - #2225

Merged
dneto0 merged 2 commits into
gpuweb:mainfrom
jrprice:restrict-pointer-to-vector-component
Nov 3, 2021
Merged

dneto0 merged 2 commits into
gpuweb:mainfrom
jrprice:restrict-pointer-to-vector-component

Conversation

@jrprice

@jrprice jrprice commented Oct 29, 2021

Copy link
Copy Markdown
Contributor

Closes #1931

@jrprice jrprice added the wgsl WebGPU Shading Language Issues label Oct 29, 2021
@jrprice
jrprice requested review from dneto0, kvark and litherum October 29, 2021 20:00
@github-actions

Copy link
Copy Markdown
Contributor

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

Comment thread wgsl/index.bs Outdated
It is a [=shader-creation error=] if |SC| is the [=storage
classes/handle=] storage class.

It is a [=shader-creation error=] if |r| is the result of a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The cross-reference is really broad
I suggest pointing instead at
https://gpuweb.github.io/gpuweb/wgsl/#component-reference-from-vector-reference

.... |r| is a component reference of a vector reference

Also, the sentence (at 6.7.1.3) "A write access to component of a vector may access all of the memory locations associated with that vector." and its following "Note" would not longer be able to be applied.

Maybe it should be replaced by "There is no way to write to a single component of a vector, or any proper subset of the components of a vector."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've updated the cross reference to link to the "component reference from vector reference" section.

I don't agree with the rest of your comment though. We're not removing the ability to write to a single component of a vector (v.x = 1.0; is still valid), so the note in that section still applies.

@jrprice
jrprice requested a review from dneto0 November 2, 2021 15:25
@github-actions

github-actions Bot commented Nov 2, 2021

Copy link
Copy Markdown
Contributor

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

@dneto0
dneto0 merged commit 58f1b04 into gpuweb:main Nov 3, 2021
github-actions Bot added a commit that referenced this pull request Nov 3, 2021
SHA: 58f1b04
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 Nov 3, 2021
SHA: 58f1b04
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 Nov 3, 2021
SHA: 58f1b04
Reason: push, by @dneto0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@jrprice
jrprice deleted the restrict-pointer-to-vector-component branch November 3, 2021 01:47
RobinMorisset pushed a commit to RobinMorisset/gpuweb that referenced this pull request Nov 4, 2021
* wgsl: Disallow taking the address of a vector component

Closes gpuweb#1931

* Link to component reference from vector reference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wgsl WebGPU Shading Language Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MSL does not support address-of vector component

3 participants