Skip to content

Allow aliased resource variables - #3581

Merged
dneto0 merged 2 commits into
gpuweb:mainfrom
alan-baker:aliased-resources
Nov 7, 2022
Merged

dneto0 merged 2 commits into
gpuweb:mainfrom
alan-baker:aliased-resources

Conversation

@alan-baker

Copy link
Copy Markdown
Contributor

Contributes to #1842

  • Clarify a memory view depends on the memory model reference
  • Allow aliased resources, but make it a dynamic error if the aliased resources are mutable
  • Clarify that resource variables form a memory model reference based on the group and binding pair
  • Clarify resource variable may have overlapping memory locations

Contributes to gpuweb#1842

* Clarify a memory view depends on the memory model reference
* Allow aliased resources, but make it a dynamic error if the aliased
  resources are mutable
* Clarify that resource variables form a memory model reference based on
  the group and binding pair
* Clarify resource variable may have overlapping memory locations
@alan-baker alan-baker added the wgsl WebGPU Shading Language Issues label Nov 7, 2022
@alan-baker alan-baker added this to the V1.0 milestone Nov 7, 2022
@github-actions

github-actions Bot commented Nov 7, 2022 •

Copy link
Copy Markdown
Contributor

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

Comment thread wgsl/index.bs Outdated
Bindings [=shader-creation error|must not=] alias within a [=shader=]:
two different variables in the resource interface of a given
shader [=shader-creation error|must not=] have the same group and binding values, when considered as a pair of values.
It is a [=dynamic error=] if two mutable resource variables have the same pair

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.

This is not the kind of aliasing that is wanted.

They want the same memory locations to be accessilble from resources with distinct (group,binding).
Not that they want to allow two variables with the same (group,binding).

Maybe it's best to avoid using the word "aliasing" here at all, and simplify:

Two different resource variables in a [=shader=] [=...|must not=] have the same group and binding values, when considered as a pair.

Comment thread wgsl/index.bs Outdated
the unique [=attribute/group=] and [=attribute/binding=] pair.
All other variables (i.e. variables in the [=address spaces/function=],
[=address spaces/private=], and [=address spaces/workgroup=] address spaces)
for a unique [=memory model reference=] for the lifetime of the variable.

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.

"form"

So "Each other variable .... forms a ..."

@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.

Thanks!

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.

2 participants