Builtin Library
- ..
- README.md926 B
- bindings.yaml1.2 KB
- shader.wgsl4.8 KB
README.md
scan_mat4
The running product of a run of 4x4 matrices, whole or per segment: the frames of a sweep, each placed relative to the one before it.
A matrix is 16 consecutive floats, column by column. The product runs in run
order, so out[i] = m[0] * m[1] * ... * m[i]. params.exclusive picks the
product of the matrices before each one (the identity for the first) or the
product up to and including it. total holds each group's product, the
identity for an empty group. A segmented scan (params.segments above 0, the
number of segments) restarts at each start in starts.
One workgroup scans one group at a time, a tile of 128 matrices at a time, with
the product of everything before a tile carried into the next. The dispatch size
n is the number of matrices; any workgroup count from 1 up scans every group.
Exact: the order of multiplication is fixed, so the same run gives the same bits on every dispatch.