Luxar Viewer API Documentation - v2026.10.22
    Preparing search index...

    Module rendering/gpu-depth-sort/scratch

    The GPU depth sort's scratch buffers and the bind groups over them, sized for one capacity.

    Buffers (N = capacity, rounded up to whole blocks):

    buffer bytes role
    primary 4N depth, keys, odd-pass keys, then the final order
    keys 4N keys after the even radix passes
    values[2] 4N each element indices between passes (ping-pong)
    hist 4·16·N/4096 digit-major block histograms, then offsets
    totals[l] small each scan level's workgroup totals
    bounds 8 ordered-u32 min and max of in-front depth
    uniforms 256 B per slot params, the four digit shifts, each scan length

    The four radix passes route keys and indices like this:

    pass keys in indices in keys out indices out
    0 primary (element i) keys values[0]
    1 keys values[0] primary values[1]
    2 primary values[1] keys values[0]
    3 keys values[0] — primary

    primary ends up holding the order and is copied into the target ordering attribute, so the attribute keeps three's own buffer usage. The scratch is shared by every node a sorter serves: each sort writes its uniforms and submits before the next one starts, and the queue runs them in order.

    SortScratch
    RadixPassBindGroups
    ScratchBindGroups
    UniformEntry
    PARAMS_SLOT
    SCAN_SLOT