Function createStorageBuffer
-
createStorageBuffer(
engine: EngineContext,
source: number | ArrayBufferView<ArrayBufferLike>,
labelOrOptions?: string | StorageBufferOptions,
): StorageBufferParameters
- engine: EngineContext
- source: number | ArrayBufferView<ArrayBufferLike>
OptionallabelOrOptions: string | StorageBufferOptions
Returns StorageBuffer
Create a shader storage buffer.
sourceis 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 — passwritable/vertexto opt in.