wgblas
    Preparing search index...
    • 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.

      Parameters

      • device: GPUDevice
      • data:
            | Float32Array<ArrayBufferLike>
            | Uint32Array<ArrayBufferLike>
            | Int32Array<ArrayBufferLike>
      • Optionallabel: string = "blas-input"

        debug label visible in browser DevTools GPU inspection

      • Optionalreadback: boolean = false

        add COPY_SRC so the buffer can be copied to a readback buffer

      Returns GPUBuffer

      if data.byteLength exceeds the device's maxStorageBufferBindingSize