-
Notifications
You must be signed in to change notification settings - Fork 370
Spec changes for atomic vec2u #5610
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
Open
petermcneeleychromium
wants to merge
5
commits into
gpuweb:main
Choose a base branch
from
petermcneeleychromium:spec_changes_for_atomic_vec2u
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Minor comments
- Loading branch information
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1863,8 +1863,8 @@ The valid [=enable-extensions=] are listed in the following table. | |
| <tr><td><dfn noexport dfn-for="extension">`atomic_vec2u_min_max`</dfn> | ||
| <td>[=atomic-vec2u-min-max|"atomic-vec2u-min-max"=] | ||
| <td>The built-in functions [[#atomic-store-min|atomicStoreMin]] and | ||
| [[#atomic-store-max|atomicStoreMax]] are valid to use on `atomic<vec2u>` | ||
| objects in the WGSL module. Otherwise, using these will result in a | ||
| [[#atomic-store-max|atomicStoreMax]] are valid to use on atomic<[=vec2u=]> | ||
| types in the [=address spaces/storage=] address space. Otherwise, using these will result in a | ||
| [=shader-creation error=]. | ||
| </table> | ||
|
|
||
|
|
@@ -2009,11 +2009,6 @@ Extension names are not [=identifiers=]: they do not [=resolves|resolve=] to [=d | |
| <td> | ||
| Supports the [=built-in values/global_invocation_index=] and | ||
| [=built-in values/workgroup_index=] [=built-in values=]. | ||
| <tr><td><dfn for="language_extension">atomic_vec2u_min_max</dfn> | ||
| <td> | ||
| Supports the [[#atomic-store-min|atomicStoreMin]] and | ||
| [[#atomic-store-max|atomicStoreMax]] built-in functions | ||
| on [[#atomic-types|atomic<vec2u>]] objects. | ||
|
|
||
| </table> | ||
|
|
||
|
|
@@ -3061,7 +3056,7 @@ An <dfn noexport>atomic type</dfn> encapsulates a [=type/concrete=] [=integer sc | |
| <tr algorithm="atomic type"><td>atomic<<dfn dfn-for="atomic" noexport>|T|</dfn>> | ||
|
petermcneeleychromium marked this conversation as resolved.
|
||
| <td>Atomic of type |T|. Unless otherwise specified, |T| [=shader-creation error|must=] be either [=u32=] or [=i32=]. | ||
| <tr algorithm="atomic type vecu"><td>atomic<[=vec2u=]> | ||
| <td>Atomic of type [=vec2u=]. A 64-bit atomic type via a composite. Requires the [=language_extension/atomic_vec2u_min_max=] extension. | ||
| <td>Atomic of type [=vec2u=]. This composite constitutes a 64-bit atomic type and is structurally equivalent to a bitcast. Requires the [=extension/atomic_vec2u_min_max=] extension. | ||
|
petermcneeleychromium marked this conversation as resolved.
Outdated
|
||
| </table> | ||
|
|
||
| An expression [=shader-creation error|must not=] evaluate to an atomic type. | ||
|
|
@@ -18986,7 +18981,7 @@ is, the `exchanged` member of the result structure may be `false` even if the | |
| ### Atomic Store Min and Max Functions ### {#atomic-store-min-max} | ||
|
|
||
| The functions in this section [=behavioral requirement|will=] be available only if | ||
| the [=language_extension/atomic_vec2u_min_max=] [=language extension=] is supported. | ||
| the [=extension/atomic_vec2u_min_max=] [=enable-extension=] is enabled. | ||
|
|
||
| Each function performs the following steps atomically: | ||
|
|
||
|
|
@@ -18995,10 +18990,11 @@ Each function performs the following steps atomically: | |
| name with the value |v|. | ||
| 3. Store the new value using `atomic_ptr`. | ||
|
|
||
| The functions do not return any values. | ||
| The functions do not return a value. | ||
|
|
||
| For the functions in this section: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe hardcoding these constraints is better.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With that done, these constraints can be removed. |
||
| - |T| [=shader-creation error|must=] be [=vec2u=]. | ||
| - This composite operationally behaves as a single 64-bit unsigned integer scalar. | ||
| - `AS` [=shader-creation error|must=] be [=address spaces/storage=]. | ||
|
|
||
| #### `atomicStoreMin` #### {#atomic-store-min} | ||
|
|
@@ -19014,6 +19010,7 @@ with the value `v`. | |
| <xmp highlight=wgsl> | ||
| // All operations are performed atomically | ||
| fn atomicStoreMin(atomic_ptr: ptr<AS, atomic<T>, read_write>, v : T) { | ||
|
petermcneeleychromium marked this conversation as resolved.
Outdated
|
||
| // both 'old' and 'v' behave operationally as 64-bit unsigned integer scalars | ||
| let old = *atomic_ptr; | ||
| *atomic_ptr = min(old, v); | ||
| } | ||
|
|
@@ -19033,6 +19030,7 @@ with the value `v`. | |
| <xmp highlight=wgsl> | ||
| // All operations are performed atomically | ||
| fn atomicStoreMax(atomic_ptr: ptr<AS, atomic<T>, read_write>, v : T) { | ||
|
petermcneeleychromium marked this conversation as resolved.
Outdated
|
||
| // both 'old' and 'v' behave operationally as 64-bit unsigned integer scalars | ||
| let old = *atomic_ptr; | ||
| *atomic_ptr = max(old, v); | ||
| } | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I'd definitely link atomic to atomic types here.