Create a new StorageBuffer instance.
The graphics device used to manage this storage buffer.
The size of the storage buffer in bytes.
Optional
bufferUsage: number = 0The usage type of the storage buffer. Can be a combination of BUFFERUSAGE_READ, BUFFERUSAGE_WRITE, BUFFERUSAGE_COPY_SRC and BUFFERUSAGE_COPY_DST flags. This parameter can be omitted if no special usage is required.
Issues a write operation of the provided data into a storage buffer.
The offset in bytes to start writing to the storage buffer.
The data to write to the storage buffer.
Offset in data to begin writing from. Given in elements if data is a TypedArray and bytes otherwise.
Size of content to write from data to buffer. Given in elements if data is a TypedArray and bytes otherwise.
A storage buffer represents a memory which both the CPU and the GPU can access. Typically it is used to provide data for compute shader, and to store the result of the computation. Note that this class is only supported on the WebGPU platform.