Skip to content

Remove restrictions on user-defined pointer parameters - #4312

Merged
dneto0 merged 2 commits into
gpuweb:mainfrom
alan-baker:unrestricted-pointer-params
Oct 6, 2023
Merged

dneto0 merged 2 commits into
gpuweb:mainfrom
alan-baker:unrestricted-pointer-params

Conversation

@alan-baker

Copy link
Copy Markdown
Contributor

Fixes #3546

  • Removes address space and memory view restrictions on pointer parameters for user-defined functions
  • removes built-in function address space listing since it is no longer relevant
  • adds language extension unrestricted_pointer_parameters

Fixes gpuweb#3546

* Removes address space and memory view restrictions on pointer
  parameters for user-defined functions
* removes built-in function address space listing since it is no longer
  relevant
* adds language extension unrestricted_pointer_parameters
@alan-baker alan-baker added wgsl WebGPU Shading Language Issues language extension labels Oct 2, 2023
@alan-baker alan-baker added this to the Milestone 1 milestone Oct 2, 2023
@alan-baker

Copy link
Copy Markdown
Contributor Author

Note: this will conflict with #4311 (or vice versa) due to the language extensions changes.

@github-actions

github-actions Bot commented Oct 2, 2023 •

Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (60adb5c):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

* Split formal parameters into more cases
  * non-pointers as before
  * pointer non-read-only storage, workgroup, or private with load rule
    * edge to MayBeNonUniform
  * pointer non-read-only storage, workgroup, or private with no load rule
    * like module scope read only var
  * pointer read-only non-function
    * like module scope read only var

@dneto0 dneto0 left a comment

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.

LGTM thanks!

Comment thread wgsl/index.bs
bar(e_func); // Valid, effectively address-of a variable.

baz2(&ro_storage); // Valid, address-of a variable.
baz2(&rw_storage); // Invalid, access mode mismatch.

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.

Good.

Comment thread wgsl/index.bs
<td>*X* is the node corresponding to "x"
<td class="nowrap">*CF*, *Result*
<td class="nowrap">*Result* -> {*CF*, *X*}
<tr><td>identifier [=resolves|resolving=] to a [=formal parameter=] of

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.

Uniformity rules update LGTM.

@dneto0
dneto0 merged commit 9298d2f into gpuweb:main Oct 6, 2023
Comment thread wgsl/index.bs
<th>Description
<tr><td colspan=2 class=note><span class="marker">Note:</span> No [=language extensions=] are currently defined.
</thead>
<tr><td>unrestricted_pointer_parameters

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.

I realized this name hasn't been reviewed by the committee..... oops.

@dneto0

dneto0 commented Oct 10, 2023

Copy link
Copy Markdown
Contributor

I'm getting feedback that it's bad that the details of the restrictions are now completely lost.

@alan-baker

alan-baker commented Oct 10, 2023 •

Copy link
Copy Markdown
Contributor Author
WGSL meeting minutes 2023-10-10
  • AB: David merged this prematurely. Two questions. 1. Review language feature name, 2. Intentionally didn’t want to pollute the spec with a mass of conditionals and interactions. In this case it’s a deletion of a bunch of text (which is now lost).
  • JB: As long as it’s sufficiently clear what’s disabled, it’s ok ot generally describe the spec as all features are on.
  • DN: In this case it’s an entire deletion of sets of conditions.
  • TT: Descriptions is too vague in this case.
  • AB: This case we can reword. Pull the restrictions into the description of the feature.
  • JB: That sounds better.
  • BC: The name is quite wordy. The language uses ‘ptr’, use it there?
    Leave the name as is.
  • AB: I’ll revert this, make changes,** tag the spec, and I’ll draft the new changes.**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

language extension wgsl WebGPU Shading Language Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support fuller-featured pointers (as per #3276)

2 participants