Parameters used to create a Buffer.

interface BufferParams {
    size?: number;
    label?: string;
    usage?: BufferUsageKeys[];
    mappedAtCreation?: boolean;
}

Hierarchy

  • Partial<Omit<GPUBufferDescriptor, "usage">>
    • BufferParams

Properties

size?: number

The size of the buffer in bytes.

label?: string

The label of the GPUBuffer, useful for debugging purpose.

usage?: BufferUsageKeys[]

Allowed usages for the GPUBuffer as an array of buffer usages names

mappedAtCreation?: boolean

Whether to create the GPUBuffer in an already mapped state. See mappedAtCreation (WebGPU API reference).