Skip to content

Cannot use atomicStore with atomicLoad together #30634

@HongchengZhao

Description

@HongchengZhao

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    TSLThree.js Shading LanguageWebGPU

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions