@pmndrs/bvh
    Preparing search index...

    Class GpuLbvhBatch

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

    Index
    • Parameters

      • device: GPUDevice
      • label: string
      • pipelines: Record<LbvhKernel, GPUComputePipeline>
      • sortPipelines: RadixSortPipelines
      • geometries: readonly GpuMeshGeometry[]
      • options: Required<GpuBuildOptions>

      Returns GpuLbvhBatch

    meshCount: number

    The node format finish hands out (the batch builds f32 nodes either way).

    triangleLeaves: GpuLayoutTriangleLeaves

    The triangle format the batch writes.

    • 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"
                | "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>