Used to handle GPUTexture and GPUExternalTexture bindings.

Provide both resourceLayout and resource to the GPUBindGroupLayout and GPUBindGroup.
Also create the appropriate WGSL code snippet to add to the shaders.

Hierarchy (view full)

Constructors

Properties

label: string

The label of the Binding

name: string

The name/key of the Binding

visibility: number

The visibility of the Binding in the shaders

shouldResetBindGroup: boolean

Flag indicating whether we should recreate the parentMesh bind group, usually when a resource has changed

shouldResetBindGroupLayout: boolean

Flag indicating whether we should recreate the parentMesh GPU bind group layout, usually when a resource layout has changed

cacheKey: string

A cache key allowing to get / set bindings from the device manager map cache. Used for BufferBinding only at the moment.

The binding type of the TextureBinding

Our TextureBinding resource, i.e. a GPUTexture or GPUExternalTexture

wgslGroupFragment: string[]

An array of strings to append to our shaders code declaring all the WGSL variables representing this TextureBinding

Options used to create this TextureBinding

Accessors

  • get resourceLayout(): GPUTextureBindingLayout | GPUExternalTextureBindingLayout | GPUStorageTextureBindingLayout
  • Get bind group layout entry resource, either for GPUBindGroupLayoutEntry#texture | texture or GPUBindGroupLayoutEntry#externalTexture | external texture

    Returns GPUTextureBindingLayout | GPUExternalTextureBindingLayout | GPUStorageTextureBindingLayout

Methods