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

    Module rendering/gpu-depth-sort/gpu-depth-sorter

    Back-to-front depth ordering on the GPU (WebGPU compute, #3162).

    The native WebGPU counterpart of the SortWorker's counting sort: the same 16-bit view-depth keys (see wgsl.ts for the arithmetic and its tolerance), sorted by a stable four-pass (4-bit digit) LSD radix sort, written into an ordering attribute's GPU buffer. Nothing crosses the CPU: the centers are read from the element texture the geometry already uploaded, and the order lands in the buffer the vertex shader reads, so a re-sort costs no 4-byte-per-element upload and no worker round trip.

    One sorter per GPUDevice. GpuDepthSorter.create compiles the pipelines asynchronously; scratch grows to the largest element count seen. Each GpuDepthSorter.sort records one command buffer and submits it, so sorts of several nodes run one after another on the queue and can share the scratch.

    GpuDepthSorter
    DepthSortRequest