@pmndrs/bvh
    Preparing search index...

    Class GpuHplocBatch

    One batch of mesh builds: inputs, scratch and outputs, recorded into one compute pass.

    Index
    meshCount: number

    The node format finish hands out (the batch builds f32 nodes and packs them, unless quantizeOnEmit).

    parents: boolean

    The batch writes each node's parent (GpuHplocBatchOptions.parents).

    quantizeOnEmit: boolean

    The emit pass writes the quantized nodes itself (HplocOptions.quantizeOnEmit): no f32 nodes, no quantize pass.

    triangleLeaves: GpuLayoutTriangleLeaves

    The triangle format the batch writes.

    • get outputBytes(): number

      GPU bytes of the output trees (nodes, triangles, parents), which finish hands to the caller.

      Returns number

    • get scratchBytes(): number

      GPU bytes the batch holds until finish or destroy: its inputs, scratch and uniforms (not the outputs; 0 on a scratch pool, which counts them).

      Returns number

    • Frees the scratch, the inputs and the uniforms. Trees handed out by finish are not touched.

      Returns void

    • Records every mesh's build into encoder: copies of any GPU-buffer inputs, then one compute pass. timestampWrites (optional) times the pass.

      For a breakdown, stageTimestamps instead puts each step in a pass of its own and times it with the writes it returns. The extra passes cost a little time themselves, so use it to compare steps, not to time the build.

      Parameters

      • encoder: GPUCommandEncoder
      • OptionaltimestampWrites: GPUComputePassTimestampWrites
      • OptionalstageTimestamps: (
            stage:
                | "sort"
                | "triangles"
                | "boxes"
                | "deltas"
                | "morton"
                | "clear"
                | "climb"
                | "mark"
                | "rank"
                | "emit",
        ) => GPUComputePassTimestampWrites

      Returns void

    • Reads every mesh's stats back (one copy and one map), checks them, and returns the trees. Call after submitting an encode. Frees the batch's scratch; the trees stay until the caller destroys them.

      Returns Promise<GpuTreeBuffers>