Builtin Library
- ..
- README.md1.1 KB
- bindings.yaml1.4 KB
- shader.wgsl1.3 KB
README.md
gather
Builds a column from another column and a run of indices: element i of the
result is element index[i] of src. An index below 0 or past the end of
src gives zeros. The element type is the T specialization (f32, i32,
and two to four lanes of either); a three-lane column is read and written
tightly packed, twelve bytes an element.
Dispatch over n, the number of indices. Exact: each result element has one
writer. It declares fusion: (the value of element i is element(i), a thread
runs where skip(i) is false), so a chain of fused kernels evaluates it inside
one dispatch.
Most nodes that reorder, select or copy elements read their columns through it:
core.select, core.concat, core.make, core.weld, attribute.gather,
attribute.promote, elements.sort and the geometry nodes among them.
Over a live count (COUNT=device, see the abi README) n is the capacity and the
first domain_count slots are live: a slot at or past it holds zeros. It binds 4
storage buffers (3 in the plain variant), and dst holds n elements.