mapBuffer method

  1. @override
Future<MappedBuffer> mapBuffer(
  1. StorageBuffer buffer,
  2. MapMode mode, {
  3. int offsetInBytes = 0,
  4. int? sizeInBytes,
})
override

Maps sizeInBytes bytes (to the end by default) of buffer from offsetInBytes into host memory, once every pass submitted before this call is done with it — DeviceFeature.mappedBuffers.

The staging-buffer path, both ways: MapMode.read on a BufferUsage.hostReadable buffer that a transfer pass copied results into, MapMode.write on a BufferUsage.hostWritable one the host fills and a transfer pass copies onward. See MappedBuffer for how long the bytes are valid. readBuffer is this, copied out and unmapped, for a whole buffer.

Implementation

@override
Future<MappedBuffer> mapBuffer(
  StorageBuffer buffer,
  MapMode mode, {
  int offsetInBytes = 0,
  int? sizeInBytes,
}) {
  _unrecorded('mapBuffer');
  return inner.mapBuffer(
    buffer,
    mode,
    offsetInBytes: offsetInBytes,
    sizeInBytes: sizeInBytes,
  );
}