CommandBuffer class
CommandBuffer in this library is used as a tape to record actions for the native backend to execute. Commands are stored as a continuous stream of raw bytes. Each command constists of two parts:
OpCode (4 bytes): storing which method should be executed on the backend
Arguments: providing additional arguments for the operation. Example:
[OpCode (4 bytes)] [Len A (2 bytes)] [Text A] [Len B (2 bytes)] [Text B] [Len Out (2 bytes)] [Text Out]
Usually CommandBuffers do not need to be filled manually but are filled by providing them to GPUTensor- operations as arguments.
Constructors
Properties
Methods
-
bytes(
) → Uint8List - Returns a copy of the active portion of the buffer. Primarily used to decode the buffer into a Uint8List to run CommandBuffers on the GPU:
-
clear(
) → void - sets the storage offset to 0
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
patchInt(
int reservedOffset, int value) → void -
Overwrites a 4-byte int previously written at
reservedOffsetin place. -
putBool(
bool value) → void - Inserts a bool into the buffer
-
putFloat(
double value) → void - Inserts a float into the buffer
-
putInt(
int value) → void - Inserts an integer into the buffer
-
putString(
String text) → void - Inserts a given String into the buffer vie encoding over uft-8
-
reserveInt(
) → int - Reserves 4 bytes for a value that isn't known yet and writes a 0 placeholder there. Returns the offset so the value can be overwritten later without re-recording the tape.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited