Function createBindGroup

  • This function is used to create a GPU bind group that defines a set of resources to be bound together in a group and how the resources are used in shader stages. It accepts GPU device, GPU bind group layout, uniform buffer array, and the other GPU binding resource array as its input arguments. If both the buffer and other resource arrays have none zero elements, you need to place the buffer array ahead of the other resource array. Make sure that the order of buffers and other resources is consistent with the @group @binding attributes defined in the shader code.

    Parameters

    • device: GPUDevice

      GPU device

    • layout: GPUBindGroupLayout

      GPU bind group layout that defines the interface between a set of resources bound in a GPU bind group and their accessibility in shader stages.

    • buffers: GPUBuffer[] = []

      The uniform buffer array

    • otherResources: GPUBindingResource[] = []

      The other resource array, which can include GPUSampler, GPUTextureView, GPUExternalTexture, etc.

    Returns GPUBindGroup

Generated using TypeDoc