API

Function createStorageBuffer

  • Create a shader storage buffer.

    source is either the initial contents or a byte length for an uninitialized allocation (the usual choice for a compute target, which is written before it is read). Numeric sizes must be non-negative safe integers. Capacity is rounded up to four bytes (at least four, even for an empty source) and must fit the device's maxBufferSize. Defaults to a read-only, CPU-initialized buffer — pass writable/vertex to opt in.

    Parameters

    Returns StorageBuffer