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

Add support for WGSL's atomicCompareExchangeWeak with the `__atomic… #2165

Merged
merged 3 commits into from
Dec 13, 2022

Conversation

aweinstock314
Copy link
Contributor

…_compare_exchange_result` struct, and add SPIR-V codegen for it.

Partially addresses gpuweb/gpuweb#2113, #1755.

@aweinstock314 aweinstock314 force-pushed the atomic-compare-exchange-spirv branch from 2641b3b to ee026e8 Compare December 9, 2022 08:08
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

Looks good, just missing some validation here:

comparison: _,

We should check that the comparison type is of the form:

struct __atomic_compare_exchange_result<T> {
  old_value : T; // old value stored in the atomic
  exchanged : bool; // true if the exchange was done
}

src/valid/function.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@aweinstock314 aweinstock314 force-pushed the atomic-compare-exchange-spirv branch from 8e06c82 to 462a34d Compare December 12, 2022 19:43
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

Good stuff!

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