atomicAdd
On this page

atomicAdd

Function

Adds value to the atomic location as one indivisible step and returns the value it held before (atomicAdd(bins[i], 1)).

The signature and the sentence under each name are the compiler's own text at commit 26de7be8.

Syntax

declare function atomicAdd<T extends u32 | i32>(location: atomic<T>, value: T): T

Parameters

Return value

T

Description

Wraps at 32 bits. Compiles to atomicAdd(&bins[i], v) on WGSL only.

Targets

WGSL
atomicAdd(&a, b)
GLSL ES 3.00
atomicAdd has no GLSL ES 3.00 spelling (no storage buffers, no atomics)

Examples

See also

Edit this page Report a problem