writeBuffer method

void writeBuffer(
  1. GPUBuffer buffer,
  2. int bufferOffset,
  3. JSObject data, [
  4. int dataOffset,
  5. int size,
])

Bytes into a buffer.

dataOffset and size are counted in elements of data, not in bytes, which is the one place this API changes units on its caller. Omitted, the whole of data is written — which is what a backend uploading a whole mesh wants, and the reason they are optional rather than required zeros.

Implementation

external void writeBuffer(
  GPUBuffer buffer,
  int bufferOffset,
  JSObject data, [
  int dataOffset,
  int size,
]);