Documentation
    Preparing search index...

    Interface GpuBuffer

    An opaque GPU buffer handle.

    The three mapping members are optional, and presence is the capability — R-30b's optional-context-member rule, applied here so every double built before WP-R1.6's readback still satisfies the type. Only a buffer created with MAP_READ usage may be mapped, and only readPixels creates one; WebgpuRenderer.readPixels rejects with UNSUPPORTED_GPU_FEATURE on a device whose buffers cannot map, rather than crashing into an absent member.

    interface GpuBuffer {
        destroy(): void;
        getMappedRange?(): ArrayBuffer;
        mapAsync?(mode: number): Promise<void>;
        unmap?(): void;
    }
    Index
    • Releases the allocation (§83).

      Returns void

    • The mapped bytes. Valid only between mapAsync resolving and unmap.

      Returns ArrayBuffer

    • Resolves when the buffer's contents are mapped into CPU memory — WP-R1.6's readback path. mode is a GPU_MAP_MODE bit.

      Parameters

      • mode: number

      Returns Promise<void>

    • Returns the mapped range to the GPU; the ArrayBuffer is detached.

      Returns void