AdvancedCreate a new instance of the Bind Group.
Optionalresources: Record<string, BindResource>
The resources that are bound together for use by a shader.
ReadonlyresourcesThe resources that are bound together for use by a shader, keyed by binding number.
Treat this as read-only and use BindGroup#setResource to add or replace a resource. A direct write skips the bind group's change tracking: the GPU bind group is not rebuilt, and the renderer never syncs the new resource's uniforms or marks it as in use.
Destroys this bind group and removes all listeners.
Returns the resource at the current specified index.
The index of the resource to get.
Set a resource at a given index. This function will ensure that listeners will be removed from the current resource and added to the new resource.
The resource to set.
The index to set the resource at.
A bind group is a collection of resources that are bound together for use by a shader. They are essentially a wrapper for the WebGPU BindGroup class. But with the added bonus that WebGL can also work with them.
See
https://gpuweb.github.io/gpuweb/#dictdef-gpubindgroupdescriptor
Example