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 BindGroupGPUBindGroupLayout
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 s
A Set to store this BindGroup consumers (Material uuid)
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 GPU textures and samplers 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
Create the GPU buffers, bindings, entries, bindGroupLayout and bindGroup
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
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
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
keepwhether we should keep original bindGroupLayout or not
Adds a texture to the textures array and the struct
texture to add
Adds a sampler to the samplers array and the struct
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