readBufferSync abstract method

ByteData readBufferSync(
  1. StorageBuffer buffer, {
  2. int offsetInBytes = 0,
  3. int? sizeInBytes,
})

The bytes of buffer (a range of them), read back in the calling turn.

A stall, on purpose. The call waits for every pass submitted before it, which is the price WebGL2's getBufferSubData charges and the reason WebGPU has no such call. For a tool or a test that would rather block than restructure; a frame loop wants GraphicsDevice.readBuffer or GraphicsDevice.mapBuffer. buffer must be BufferUsage.hostReadable.

Implementation

ByteData readBufferSync(
  StorageBuffer buffer, {
  int offsetInBytes = 0,
  int? sizeInBytes,
});