Skip to content

Spec changes for atomic vec2u#5610

Open
petermcneeleychromium wants to merge 5 commits intogpuweb:mainfrom
petermcneeleychromium:spec_changes_for_atomic_vec2u
Open

Spec changes for atomic vec2u#5610
petermcneeleychromium wants to merge 5 commits intogpuweb:mainfrom
petermcneeleychromium:spec_changes_for_atomic_vec2u

Conversation

@petermcneeleychromium
Copy link
Copy Markdown
Contributor

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.

Peter McNeeley added 2 commits March 22, 2026 18:15
Copy link
Copy Markdown
Contributor

@alan-baker alan-baker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Maybe hardcoding these constraints is better.

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.

With that done, these constraints can be removed.

@petermcneeleychromium
Copy link
Copy Markdown
Contributor Author

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

I use it as the name of the enable !

@alan-baker
Copy link
Copy Markdown
Contributor

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

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

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

Copy link
Copy Markdown
Contributor

@alan-baker alan-baker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits mostly.

<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&lt;[=vec2u=]&gt;
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.

Nit: I'd definitely link atomic to atomic types here.


The functions do not return a value.

For the functions in this section:
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.

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>) {
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.

Same here.


### Atomic Types ### {#atomic-types}

An <dfn noexport>atomic type</dfn> encapsulates a [=type/concrete=] [=integer scalar=] type such that:
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.

Feels like this ought to change. No certain how though.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants