@pmndrs/bvh
    Preparing search index...

    Class GpuRefitBoxPool

    One primitive-box buffer for several mesh refits (P9, "refit buffer pooling", docs/internals/design/memory.md): the boxes (32 bytes per triangle) are written and read only inside each refit's own dispatches, so refits recorded one after another in a pass can take turns with one buffer sized for the largest mesh instead of one buffer each. The dispatches of a pass run in order, each seeing the writes of the ones before.

    The rule for sharing: the refits' GpuMeshRefit.encode calls must not overlap (one at a time into a pass, or into passes submitted in order), and GpuMeshRefit.setTree may grow the buffer, which retires the old one until releaseRetired: call it once the frames that used the old buffer were submitted (DeformingTrees does at each update).

    Index
    • get buffer(): GPUBuffer

      The shared buffer: replaced when a refit needs more than it holds.

      Returns GPUBuffer

    • get memoryBytes(): number

      GPU bytes of the buffer in use and of the ones retired, not yet released.

      Returns number

    • Destroys the buffers replaced since the last call (the frames that used them were submitted).

      Returns void

    • Makes the buffer hold at least bytes (a refit's boxes): a bigger one replaces it, the old one is retired.

      Parameters

      • bytes: number

      Returns void