Documentation
    Preparing search index...

    Class WgpuComputeBuffer

    A storage buffer the application owns (§82, §83) — created by WebgpuRenderer.createComputeBuffer, disposed by whoever created it.

    Allocated STORAGE | COPY_DST | COPY_SRC, so every compute buffer can be written (writeComputeBuffer), bound to a kernel, and read back (readComputeBufferBytes) — three usage bits against a per-usage-tier split that would complicate §82's tiny surface for no measured saving. (wgpu-particle-simulation.ts mints one with VERTEX added, for a buffer the §36 draw also binds as an instance stream — its header owns the deviation.)

    The one implementor of @fourjs/render's structural ComputeBuffer (the Q3 promotion): the brand plus the §83 trio are the cross-seam face; WgpuComputeBuffer.buffer stays this backend's own.

    Implements

    Index
    buffer: GpuBuffer

    The device allocation — a backend seam, not an application surface: the dispatch and readback paths read it, and nothing else should.

    byteLength: number

    Allocation size in bytes.

    isComputeBuffer: true

    The ComputeBuffer brand — one property load discriminates.

    • Releases the allocation (§83). Idempotent — and safe after a device loss: WebGPU's destroy() on an invalidated buffer is a defined no-op, unlike GL's delete-on-a-lost-context.

      Returns void