-
-
Notifications
You must be signed in to change notification settings - Fork 36k
AtomicFunctionNode: add inline support #30732
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
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
I believe that with this PR we can't do: The usual WGSL syntax: const a = atomicAdd(buffer.element(0), 1).toConst('a') nor: const a = uint(0).toVar('a')
atomicAdd(buffer.element(0), 1, a) /cc @sunag |
Hmm.. I think the usage of three.js/examples/webgpu_compute_sort_bitonic.html Lines 236 to 239 in 4e3db42
|
Not really, in most case with atomic operations we need to access the value of the operation while doing it (see my syntax in my previous message), for example doing an operation in a loop while trying to access to that value updated. It's currently not possible anymore, only vagabond operation which is very limiting. |
I still don't understand your example exactly, but I believe you are referring to the function call not being added to the Stack immediately? |
Ah sorry about that, I should have provided a better example. But basically from the specs:
For example: fn atomicAdd(atomic_ptr: ptr<AS, atomic<T>, read_write>, v: T) -> T Which means that any atomic operation will return a value, so it would be great to be able to easily read the returned value, for example:
This was possible to do before this PR via:
but not anymore. |
Seconding @RenaudRohlinger, this update broke some of my projects because I can't access the return value of the atomic operation anymore. |
I'm making a fix for this, just need to do a few more checks. |
Fixes: #30634
Description
Add inline support for
a.assign(b)
and removed the redundant.storeNode
.