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

Cannot use atomicStore with atomicLoad together #30634

Open
HongchengZhao opened this issue Mar 1, 2025 · 0 comments
Open

Cannot use atomicStore with atomicLoad together #30634

HongchengZhao opened this issue Mar 1, 2025 · 0 comments
Labels
TSL Three.js Shading Language WebGPU

Comments

@HongchengZhao
Copy link

HongchengZhao commented Mar 1, 2025

Description

It always fails when I try to load an element from an array of atomic uint, and store it to another array. I wonder if I am doing something wrong or it is a bug?

Reproduction steps

1. define two atomic arrays a and b
2. in a compute shader, load an element from a and store it to b

Code

const a = instancedArray(new Uint32Array([1, 2, 3]), "uint").toAtomic();
const b = instancedArray(new Uint32Array([3, 2, 1]), "uint").toAtomic();
atomicStore(b.element(2), atomicLoad(a.element(0)));

Live example

Screenshots

Image

Version

r174

Device

Desktop

Browser

Edge

OS

MacOS

@Mugen87 Mugen87 added WebGPU TSL Three.js Shading Language labels Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TSL Three.js Shading Language WebGPU
Projects
None yet
Development

No branches or pull requests

2 participants