A bind group represents a collection of UniformBuffer, Texture and StorageBuffer instanced, which can be bind on a GPU for rendering.

Constructors

  • Create a new Bind Group.

    Parameters

    • graphicsDevice: GraphicsDevice

      The graphics device used to manage this uniform buffer.

    • format: BindGroupFormat

      Format of the bind group.

    • OptionaldefaultUniformBuffer: UniformBuffer

      The default uniform buffer. Typically a bind group only has a single uniform buffer, and this allows easier access.

    Returns BindGroup

Properties

defaultUniformBuffer: UniformBuffer
uniformBufferOffsets: number[] = []

An array of offsets for each uniform buffer in the bind group. This is the offset in the buffer where the uniform buffer data starts.

uniformBuffers: UniformBuffer[]

Methods

  • Assign a storage buffer to a slot.

    Parameters

    • name: string

      The name of the storage buffer slot.

    • storageBuffer: StorageBuffer

      The storage buffer to assign to the slot.

    Returns void

  • Assign a uniform buffer to a slot.

    Parameters

    • name: string

      The name of the uniform buffer slot

    • uniformBuffer: UniformBuffer

      The Uniform buffer to assign to the slot.

    Returns void