GeometryBufferArena class Geometry

Packs immutable mesh uploads into shared GPU buffers.

Pass one arena to many MeshGeometry objects to avoid one GPU allocation per mesh. Uploads are bump-allocated into fixed-size blocks, filling the first block with room, while uploads larger than blockSizeInBytes receive a dedicated block. Geometry buffer views retain their blocks, so the arena itself need not outlive the meshes.

The arena never reclaims space. An allocation stays reserved for as long as the arena is alive, whether or not the geometry that used it still exists, so an arena only ever grows. Use it for geometry loaded or generated in batches with a lifetime the arena can share (a level, a screen), and drop the arena with them. Geometry rebuilt every frame belongs in GeometryStorage.updatable, which reuses its buffers in place; an updatable geometry cannot use an arena.

Constructors

GeometryBufferArena({int blockSizeInBytes = 16 * 1024 * 1024})
Creates an arena with the given minimum block size.

Properties

blockSizeInBytes → int
Minimum size of each GPU buffer block.
final
bufferCount → int
Number of GPU buffers allocated by this arena.
no setter
capacityInBytes → int
Total bytes reserved across all GPU buffers.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
usedInBytes → int
Bytes consumed by geometry data and alignment padding.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited