emplace method

BufferView emplace(
  1. ByteData bytes
)

Append byte data to the end of the HostBuffer and produce a BufferView that references the new data in the buffer.

This method automatically inserts padding in-between emplace calls in the buffer if necessary to abide by platform-specific uniform alignment requirements.

The updated buffer will be uploaded to the GPU if the returned BufferView is used by a rendering command.

Implementation

BufferView emplace(ByteData bytes) {
  int resultOffset = _emplaceBytes(bytes);
  return BufferView(this,
      offsetInBytes: resultOffset, lengthInBytes: bytes.lengthInBytes);
}