TextureBindGroup constructor
a Renderer class object or a GPUCurtains class object.
parameters used to create our TextureBindGroup.
The type of the BindGroup.
The universal unique id of the BindGroup.
The Renderer used.
Options used to create this BindGroup.
Index of this BindGroup, used to link struct in the shaders.
Our BindGroup GPUBindGroup.
A cache key allowing to get / set GPUBindGroupLayout from the device manager map cache.
A cache key allowing the PipelineManager to compare RenderPipelineEntry bind groups content.
Flag indicating whether we need to flush and recreate the pipeline using this BindGroup.
A Set to store this BindGroup consumers (Material uuid).
A BufferBinding with all the MediaTexture modelMatrix if any.
Get all bind group bindings that handle a GPUBuffer
Get the current textures array.
Get whether the GPU bind group is ready to be created. It can be created if it has BindGroup#bindings and has not been created yet and all GPUTexture and GPUSampler are created.
Sets our bind group index.
bind group index to set.
bindings to add.
binding to add.
Destroy a BufferBinding buffers.
BufferBinding from which to destroy the buffers.
Creates Bindings based on a list of inputs.
inputs (uniform or storage) that will be used to create the binding.
Create and adds bindings based on inputs provided upon creation.
Reset the .bindGroup | bindGroup entries, recreates them and then recreate the GPU bind group.
binding to add
Reset the .bindGroupLayout | bindGroupLayout entries, recreates them and then recreate the GPU bind group layout
binding to add
Called when the device has been lost to prepare everything for restoration
Called when the device has been restored to update our bindings.
Creates binding GPUBuffer with correct params.
The binding element.
Optional label to use for the GPUBuffer.
Get a bind group binding by name/key
the binding name or key
Create a GPUBindGroupLayout and set our bindGroupLayout
Create a GPUBindGroup and set our bindGroup
Check whether we should update (write) our GPUBuffer or not.
Clones a BindGroup from a list of bindings. Useful to create a new bind group with already created buffers, but swapped.
parameters to use for cloning.
Optional
bindings?: BindGroupBindingElement[]our input bindings.
Optional
keepLayout?: booleanwhether we should keep original bindGroupLayout or not.
Set or reset this TextureBindGroup renderer, and update the samplers and textures renderer as well.
New Renderer or GPUCurtains instance to use.
texture to add.
Set the texturesMatricesBinding if needed.
Create the texturesMatricesBinding and bindGroup.
Update the bind group textures:
Update the TextureBindGroup, which means update its textures, then update its buffer bindings and finally reset it if needed.
Destroy our TextureBindGroup.
Used to regroup all bindings related to textures (texture, texture matrices buffers and samplers) into one single specific BindGroup.
Also responsible for uploading video textures if needed.
Example