Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions wgsl/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2908,6 +2908,7 @@ Each memory access is performed via a [=memory view=].

A <dfn noexport>memory view</dfn> comprises:
* a set of [=memory locations=] in a particular [=address space=],
* a [[#memory-model-reference|memory model reference]],
* an interpretation of the contents of those locations as a WGSL [=type=], known as the <dfn noexport>store type</dfn>, and
* an [=access mode=].

Expand Down Expand Up @@ -4310,8 +4311,10 @@ The lifetime of a function-scope variable is determined by its scope:
That is, the lifetime includes any functions [=function call|called=] while
the name is in scope.

Two variables with overlapping lifetimes will not have [=overlap|overlapping
memory=] locations.
Two [=resource=] variables may have [=overlap|overlapping memory=] locations,
but it is a [=dynamic error=] if either of those variables is mutable.
Other variables with overlapping lifetimes will not have overlapping memory
locations.
When a variable’s lifetime ends, its memory may be used for another variable.

Note: WGSL ensures the contents of a variable are only observable during the
Expand Down Expand Up @@ -8722,9 +8725,9 @@ Together with the shader's stage, these identify the binding address
of the resource on the shader's pipeline.
See [[WebGPU#pipeline-layout|WebGPU &sect; GPUPipelineLayout]].

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.
Two different resource variables in a [=shader=] [=shader-creation error|must
not=] have the same [=attribute/group=] and [=attribute/binding=] values, when
considered as a pair.

### Resource Layout Compatibility ### {#resource-layout-compatibility}

Expand Down Expand Up @@ -10353,10 +10356,11 @@ member.

## Memory Model Reference ## {#memory-model-reference}

Each module-scope variable in WGSL forms a unique [=memory model
reference=] for the lifetime of a given entry point.
Each function-scope variable in WGSL forms a unique [=memory model
reference=] for the lifetime of the variable.
Each module-scope [=resource=] variable forms a [=memory model reference=] form
the unique [=attribute/group=] and [=attribute/binding=] pair.
Each other variable (i.e. variables in the [=address spaces/function=],
[=address spaces/private=], and [=address spaces/workgroup=] address spaces)
forms a unique [=memory model reference=] for the lifetime of the variable.

## Scoped Operations ## {#scoped-operations}

Expand Down