The copyTextureToBuffer() method of the GPUCommandEncoder interface encodes a command that copies data from a GPUTexture to a GPUBuffer. 
 
copyTextureToBuffer(source, destination, copySize)
 
The following criteria must be met when calling copyTextureToBuffer(), otherwise a GPUValidationError is generated and the GPUCommandEncoder becomes invalid.
 For the source:
  For the destination:
  - 
destination.bytesPerRowis a multiple of 256.
- The destination.buffer'sGPUBuffer.usageincludes theGPUBufferUsage.COPY_DSTflag.
 
commandEncoder.copyTextureToBuffer(
  {
    texture: sourceTexture,
  },
  {
    buffer: destinationBuffer,
  },
  {
    width: 16,
    height: 16,
    depthOrArrayLayers: 2,
  },
);