BindGroup

A group of Uniforms, Storages, Textures and Samplers described by a GPUBindGroupLayout. This is used to bind resources to a GPU resource (e.g. GPUBuffer, GPUTexture) in a shader.

Constructors

new BindGroup(options: BindGroupOptions): BindGroup

Properties

canvas

canvas: HTMLCanvasElement

canvasFormat

canvasFormat: GPUTextureFormat

context

index

index: number

label

label: string

samplers

samplers: Sampler[]

storages

storages: Storage[]

textures

textures: Texture[]

uniforms

uniforms: Uniform[]

Methods

addSamplers

addSamplers(samplers: Sampler[]): Promise<void>

addStorages

addStorages(storages: Storage[]): Promise<void>

addTextures

addTextures(textures: Texture[]): Promise<void>

addUniforms

addUniforms(uniforms: Uniform[]): Promise<void>

getDevice

getDevice(): Promise<GPUDevice>

setCanvas

setCanvas(canvas: HTMLCanvasElement): void

setDevice

setDevice(d: GPUDevice): void

setLabel

setLabel(label: string): void

updateBindGroup

updateBindGroup(): Promise<GPUBindGroup>
Update the GPUBindGroup and GPUBindGroupLayout for this bind group, if using an automatically generated layout. This will create a new bind group and bind group layout if one does not already exist. This will generally only be called once, after all resources have been added to the bind group.

You are viewing the beta docs. You may find the legacy docs more helpful.