commandEncoder.copyTextureToBuffer(
{
texture: sourceTexture,
},
{
buffer: destinationBuffer,
},
{
width: 16,
height: 16,
depthOrArrayLayers: 2,
},
);GPUCommandEncoder: copyTextureToBuffer() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.