Creates a GPU storage buffer and uploads data into it with
queue.writeBuffer — a byte copy, so bits are preserved as-is regardless
of element type (e.g. a Uint32Array's raw bit patterns survive intact,
where a round trip through a Float32Array view could canonicalize a NaN
bit pattern).
Not mappedAtCreation: creating a CPU-mappable buffer costs ~230 µs on
Dawn/Vulkan (GTX 1650) against ~12 µs for a plain one, which dominated
small calls. writeBuffer is ordered on the queue, so the data is in place
before any later submit reads it.
Creates a GPU storage buffer and uploads
datainto it withqueue.writeBuffer— a byte copy, so bits are preserved as-is regardless of element type (e.g. a Uint32Array's raw bit patterns survive intact, where a round trip through a Float32Array view could canonicalize a NaN bit pattern).Not
mappedAtCreation: creating a CPU-mappable buffer costs ~230 µs on Dawn/Vulkan (GTX 1650) against ~12 µs for a plain one, which dominated small calls. writeBuffer is ordered on the queue, so the data is in place before any later submit reads it.