Used to handle GPUSampler 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.

bindingType: "sampler"

The binding type of the SamplerBinding

sampler: GPUSampler

Our SamplerBinding resource, i.e. a GPUSampler

wgslGroupFragment: string[]

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

Options used to create this SamplerBinding

Accessors

  • get resourceLayout(): {
        sampler: GPUSamplerBindingLayout;
    }
  • Get GPUBindGroupLayoutEntry#sampler | bind group layout entry resource

    Returns {
        sampler: GPUSamplerBindingLayout;
    }

    • sampler: GPUSamplerBindingLayout

      GPUBindGroupLayout | bind group layout resource

Methods