Enum wgpu::BindingResource
source · #[non_exhaustive]pub enum BindingResource<'a> {
Buffer(BufferBinding<'a>),
BufferArray(&'a [BufferBinding<'a>]),
Sampler(&'a Sampler),
SamplerArray(&'a [&'a Sampler]),
TextureView(&'a TextureView),
TextureViewArray(&'a [&'a TextureView]),
AccelerationStructure(&'a Tlas),
}
Expand description
Resource that can be bound to a pipeline.
Corresponds to WebGPU GPUBindingResource
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Buffer(BufferBinding<'a>)
Binding is backed by a buffer.
Corresponds to wgt::BufferBindingType::Uniform
and wgt::BufferBindingType::Storage
with BindGroupLayoutEntry::count
set to None.
BufferArray(&'a [BufferBinding<'a>])
Binding is backed by an array of buffers.
Features::BUFFER_BINDING_ARRAY
must be supported to use this feature.
Corresponds to wgt::BufferBindingType::Uniform
and wgt::BufferBindingType::Storage
with BindGroupLayoutEntry::count
set to Some.
Sampler(&'a Sampler)
Binding is a sampler.
Corresponds to wgt::BindingType::Sampler
with BindGroupLayoutEntry::count
set to None.
SamplerArray(&'a [&'a Sampler])
Binding is backed by an array of samplers.
Features::TEXTURE_BINDING_ARRAY
must be supported to use this feature.
Corresponds to wgt::BindingType::Sampler
with BindGroupLayoutEntry::count
set
to Some.
TextureView(&'a TextureView)
Binding is backed by a texture.
Corresponds to wgt::BindingType::Texture
and wgt::BindingType::StorageTexture
with
BindGroupLayoutEntry::count
set to None.
TextureViewArray(&'a [&'a TextureView])
Binding is backed by an array of textures.
Features::TEXTURE_BINDING_ARRAY
must be supported to use this feature.
Corresponds to wgt::BindingType::Texture
and wgt::BindingType::StorageTexture
with
BindGroupLayoutEntry::count
set to Some.
AccelerationStructure(&'a Tlas)
Binding is backed by a top level acceleration structure
Corresponds to wgt::BindingType::AccelerationStructure
with BindGroupLayoutEntry::count
set to None.
Validation
When using (e.g. with set_bind_group
) a bind group that has been created with one or more of this binding
resource certain checks take place.
- TLAS must have been built, if not a validation error is generated
- All BLASes that were built into the TLAS must be built before the TLAS, if this was not satisfied and TLAS was
built using
build_acceleration_structures
a validation error is generated otherwise this is a part of the safety section ofbuild_acceleration_structures_unsafe_tlas
and so undefined behavior occurs.
Trait Implementations§
source§impl<'a> Clone for BindingResource<'a>
impl<'a> Clone for BindingResource<'a>
source§fn clone(&self) -> BindingResource<'a>
fn clone(&self) -> BindingResource<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more