WebGpuFrameArena class final

A bump allocator over one GPUBuffer, reset every frame. See the library comment, which is where the argument for this shape is.

Constructors

WebGpuFrameArena(GPUDevice _gpu, {required int usage, required int alignment, required String label, int initialBytes = 1 << 16})

Properties

alignment int
What every allocation's offset is rounded up to.
final
bufferCount int
How many GPUBuffers this arena is holding, for WebGpuDevice.debugTrackedResourceCount. One, until a frame overflows it, and zero once dispose has destroyed them.
no setter
hashCode int
The hash code for this object.
no setterinherited
label String
What the browser calls this buffer when it complains about it.
final
peakBytes int
The high-water mark since the arena was made, in bytes: what the largest frame so far asked of it. Diagnostic — read by dispose_test.dart, which asserts that a frame's second run allocates nothing new.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
usage int
What the buffer may be bound as — uniform, vertex or index — beside COPY_DST, which every arena needs and this adds.
final

Methods

dispose() → void
Destroys every buffer this arena holds. Called from dispose, once.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Back to the start, at the top of a frame. Safe under a frame the GPU has not finished — the library comment is the argument.
toString() String
A string representation of this object.
inherited
write(ByteData bytes) WebGpuSlice
bytes written into the arena, and where they went.

Operators

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