demo · v137

WebGPU copyBufferToBuffer — terse overload

The new copyBufferToBuffer(src, dst) overload defaults to "copy the whole source from offset 0 into dst at offset 0". The demo below copies a randomised source buffer using both call shapes and reads the destination back to prove they match.

probing…
src first 8 floats
dst first 8 floats
match
no run yet

the code

const enc = device.createCommandEncoder();
enc.copyBufferToBuffer(src, dst);          // new — whole-buffer copy
// equivalent to
enc.copyBufferToBuffer(src, 0, dst, 0, src.size);
device.queue.submit([enc.finish()]);

see also