Skip to main content

Using GPU Buffers

Buffer Operations

The ability to copy memory between CPU, buffers and textures

DimensionWebGPUWebGL2Description
writeBufferRead a buffer synchronously
readBuffer (sync)Read a buffer synchronously
readBuffer (async)❌ *Read a buffer asynchronously
copyBufferToBufferCopy a buffer to another buffer without CPU roundtrip
copyBufferToTextureCopy a buffer to a texture without CPU roundtrip
copyTextureToBufferCopy a buffer to a texture without CPU roundtrip

Remarks:

  • A WebGL extension does exist that enables asynchronous buffer reads, but it is not implemented on MacOS which is the primary development environment for luma.gl.
  • Asynchronous reads are emulated by luma.gl by providing a Promise style API. The actual reads are still asynchronous though.