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

    Module rendering/gpu-depth-sort/three-webgpu-bridge

    The GPU depth sort's view of a three.js WebGPURenderer: its device, and the GPU resources behind an element texture and an ordering attribute.

    This is the one file that reaches into three's internals for the sort (renderer.backend), the same containment as rendering/element-texture-row-upload.ts, so a three upgrade that moves them breaks here and nowhere else. The bridge never uploads anything itself:

    • a texture is handed over only once three has uploaded its CURRENT version (isElementTextureCurrent); before that the node keeps the SortWorker, so the sort can never read texels older than the commit it orders;
    • an ordering attribute's buffer is the one three created, or created here through the backend's own createStorageAttribute when three has not drawn it yet (ordering pairs on native WebGPU are storage attributes, element-storage.ts). Three later finds it and records the version, so it does not re-upload the host array over the sort. A host write still pending on the attribute makes the element-storage pump wait before the device write, for the same reason.
    GpuSortContext
    gpuSortContextGetter
    gpuSortContextFor
    createGpuSortContext