Spec changes for atomic vec2u#5610
Spec changes for atomic vec2u#5610petermcneeleychromium wants to merge 5 commits intogpuweb:mainfrom
Conversation
alan-baker
left a comment
There was a problem hiding this comment.
On the fence about using vec2u in the core spec text. I think we generally expand it out to vec2<u32> (though it is likely used in examples).
|
|
||
| The functions do not return a value. | ||
|
|
||
| For the functions in this section: |
There was a problem hiding this comment.
Maybe hardcoding these constraints is better.
There was a problem hiding this comment.
With that done, these constraints can be removed.
I use it as the name of the enable ! |
I think it's ok there. More in the type definition is where I'm less sure. |
|
Previews, as seen when this build job started (5592921): |
| <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=]> |
There was a problem hiding this comment.
Nit: I'd definitely link atomic to atomic types here.
|
|
||
| The functions do not return a value. | ||
|
|
||
| For the functions in this section: |
There was a problem hiding this comment.
With that done, these constraints can be removed.
| <div class='example wgsl global-scope' heading='Operation of atomic store max as a function'> | ||
| <xmp highlight=wgsl> | ||
| // All operations are performed atomically | ||
| fn atomicStoreMax(atomic_ptr: ptr<storage, atomic<vec2<u32>>, read_write>, v : vec2<u32>) { |
|
|
||
| ### Atomic Types ### {#atomic-types} | ||
|
|
||
| An <dfn noexport>atomic type</dfn> encapsulates a [=type/concrete=] [=integer scalar=] type such that: |
There was a problem hiding this comment.
Feels like this ought to change. No certain how though.
Original approved proposal
https://github.com/gpuweb/gpuweb/blob/main/proposals/atomic-64-min-max.md
This feature is extremely limited to side effect/mutation in storage buffers.
There is no return value so no way of creating synchronize-with sequencing.