Skip to content
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

Make atomicCompareExchangeWeak return a structure #2113

Merged
merged 1 commit into from
Sep 21, 2021

Conversation

kvark
Copy link
Contributor

@kvark kvark commented Sep 15, 2021

Fixes #2021

It looks a bit more advanced than the frexp stuff because it returns a structure that's generic over T.

@kvark kvark added the wgsl WebGPU Shading Language Issues label Sep 15, 2021
@github-actions
Copy link
Contributor

Previews, as seen when this build job started (b2f37a2):
WebGPU | IDL
WGSL
Explainer

Copy link
Contributor

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

This is nicer.
Thanks!

I'd like @ben-clayton to review.

Copy link
Collaborator

@ben-clayton ben-clayton left a comment

Choose a reason for hiding this comment

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

Looks great. One nit about the field name, but is much nicer, thank you.

wgsl/index.bs Outdated Show resolved Hide resolved
@kvark
Copy link
Contributor Author

kvark commented Sep 17, 2021

Do we want to bring this into the group discussion?
I'm fairly confident that this can go in.

@kdashg kdashg merged commit 6a3d19e into gpuweb:main Sep 21, 2021
github-actions bot added a commit that referenced this pull request Sep 21, 2021
SHA: 6a3d19e
Reason: push, by @jdashg

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@kvark kvark deleted the atomic-exchange branch September 21, 2021 18:13
github-actions bot added a commit that referenced this pull request Sep 21, 2021
SHA: 6a3d19e
Reason: push, by @jdashg

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Sep 21, 2021
SHA: 6a3d19e
Reason: push, by @jdashg

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@kdashg
Copy link
Contributor

kdashg commented Sep 21, 2021

WGSL meeting minutes 2021-09-21
  • Consensus to merge
  • MM: Does this rule need to say what we said for the frexp structure.
  • BC: It has a note.
  • TODO: Make issue to expand note to mention why you can’t name it

aweinstock314 added a commit to aweinstock314/naga that referenced this pull request Dec 9, 2022
…_compare_exchange_result` struct, and add SPIR-V codegen for it.

Partially addresses gpuweb/gpuweb#2113, gfx-rs#1755.
teoxoy pushed a commit to gfx-rs/naga that referenced this pull request Dec 13, 2022
…2165)

* Add support for WGSL's `atomicCompareExchangeWeak` with the `__atomic_compare_exchange_result` struct, and add SPIR-V codegen for it.

Partially addresses gpuweb/gpuweb#2113, #1755.

* Add tests for `atomicCompareExchangeWeak`, and support both u32 and i32 atomics with it.

* More thorough typechecking of the struct returned by `atomicCompareExchangeWeak`.
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.

atomicCompareExchangeWeak is not idiomatic
4 participants