#[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),
ExternalTexture(&'a ExternalTexture),
}unstable-wgpu-27 only.Expand description
Resource to be bound by a BindGroup for use with a pipeline.
The pipeline’s BindGroupLayout must contain a matching BindingType.
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_structuresa validation error is generated otherwise this is a part of the safety section ofbuild_acceleration_structures_unsafe_tlasand so undefined behavior occurs.
ExternalTexture(&'a ExternalTexture)
Binding is backed by an external texture.
Features::EXTERNAL_TEXTURE must be supported to use this feature.
Corresponds to wgt::BindingType::ExternalTexture.
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 moreSource§impl<'a> Debug for BindingResource<'a>
impl<'a> Debug for BindingResource<'a>
Source§impl<'a> From<BufferSlice<'a>> for BindingResource<'a>
impl<'a> From<BufferSlice<'a>> for BindingResource<'a>
Source§fn from(value: BufferSlice<'a>) -> BindingResource<'a>
fn from(value: BufferSlice<'a>) -> BindingResource<'a>
Convert a BufferSlice to an equivalent BindingResource::Buffer,
provided that it will be used without a dynamic offset.
Auto Trait Implementations§
impl<'a> Freeze for BindingResource<'a>
impl<'a> !RefUnwindSafe for BindingResource<'a>
impl<'a> Send for BindingResource<'a>
impl<'a> Sync for BindingResource<'a>
impl<'a> Unpin for BindingResource<'a>
impl<'a> !UnwindSafe for BindingResource<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.