BufferUsage class final
What a general buffer may be used for, fixed when it is made.
A promise the caller makes, which a backend may hold it to. Every backend checks the usages a call needs where its API would otherwise fail late — mapping needs hostReadable or hostWritable, an indirect draw indirect — and refuses with an ArgumentError. A backend whose API does not care (WebGL2 copies any buffer) need not check the copy usages; a caller that relies on that is relying on one backend.
- Annotations
-
- @immutable
Properties
Methods
-
contains(
BufferUsage other) → bool -
Whether every usage in
otheris in this one. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator |(
BufferUsage other) → BufferUsage
Constants
- copyDestination → const BufferUsage
- copySource → const BufferUsage
- hostReadable → const BufferUsage
-
GraphicsDevice.readBuffermay read it back — whatStorageBuffer.hostReadablerecords. - hostWritable → const BufferUsage
-
GraphicsDevice.mapBuffermay map it with MapMode.write — a staging buffer the host fills and a transfer pass copies onward. WebGPU'sMAP_WRITE. - index → const BufferUsage
- Holds indices. A backend may refuse index combined with vertex or uniform with an ArgumentError: WebGL2 binds a buffer to the element array target for its life and cannot bind it anywhere else.
- indirect → const BufferUsage
- Holds the arguments of an indirect draw or dispatch.
- standardStorage → const BufferUsage
-
Storage, copied either way: what a compute pass reads and writes, and
what
createStorageBuffermade before 1.0 folded it intoGraphicsDevice.createBuffer. - storage → const BufferUsage
-
Needs
DeviceFeature.computeorDeviceFeature.renderStageStorage. - uniform → const BufferUsage
- vertex → const BufferUsage