writeBuffer method

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

The writeBuffer() method of the GPUQueue interface writes a provided data source into a given GPUBuffer.

This is a convenience function, which provides an alternative to setting buffer data via buffer mapping and buffer-to-buffer copies. It lets the user agent determine the most efficient way to copy the data over.

Implementation

external void writeBuffer(
  GPUBuffer buffer,
  GPUSize64 bufferOffset,
  AllowSharedBufferSource data, [
  GPUSize64 dataOffset,
  GPUSize64 size,
]);