wgblas
    Preparing search index...
    • Maps readBuffer for CPU access, copies its contents into a new typed array, then unmaps. The .slice() is required — getMappedRange() returns a view into the mapped GPU memory which becomes invalid after unmap(), so we copy it out before unmapping. The buffer then goes back to its device's readback pool (see stageReadback) — only after a clean unmap; if mapping fails it is destroyed instead.

      Type Parameters

      • T extends Float32ArrayConstructor | Uint32ArrayConstructor = Float32ArrayConstructor

      Parameters

      • readBuffer: GPUBuffer

        a MAP_READ buffer produced by stageReadback

      • OptionalreadbackType: T = ...

        typed array constructor for the result

      Returns Promise<InstanceType<T>>