pub enum BindlessResourceType {
None,
Buffer,
SamplerFiltering,
SamplerNonFiltering,
SamplerComparison,
Texture1d,
Texture2d,
Texture2dArray,
Texture3d,
TextureCube,
TextureCubeArray,
DataBuffer,
}Expand description
The type of potentially-bindless resource.
Variants§
None
No bindless resource.
This is used as a placeholder to fill holes in the
BindlessDescriptor::resources list.
Buffer
A storage buffer.
SamplerFiltering
A filtering sampler.
SamplerNonFiltering
A non-filtering sampler (nearest neighbor).
SamplerComparison
A comparison sampler (typically used for shadow maps).
Texture1d
A 1D texture.
Texture2d
A 2D texture.
Texture2dArray
A 2D texture array.
Note that this differs from a binding array. 2D texture arrays must all have the same size and format.
Texture3d
A 3D texture.
TextureCube
A cubemap texture.
TextureCubeArray
A cubemap texture array.
Note that this differs from a binding array. Cubemap texture arrays must all have the same size and format.
DataBuffer
Multiple instances of plain old data concatenated into a single buffer.
This corresponds to the #[data] declaration in
crate::render_resource::AsBindGroup.
Note that this resource doesn’t itself map to a GPU-level binding
resource and instead depends on the MaterialBindGroupAllocator to
create a binding resource for it.
Implementations§
Source§impl BindlessResourceType
impl BindlessResourceType
Sourcepub fn binding_number(&self) -> Option<&'static BindingNumber>
pub fn binding_number(&self) -> Option<&'static BindingNumber>
Returns the binding number for the common array of this resource type.
For example, if you pass BindlessResourceType::Texture2d, this will
return 5, in order to match the @group(2) @binding(5) var bindless_textures_2d: binding_array<texture_2d<f32>> declaration in
bindless.wgsl.
Not all resource types have fixed binding numbers. If you call
Self::binding_number on such a resource type, it returns None.
Note that this returns a static reference to the binding number, not the
binding number itself. This is to conform to an idiosyncratic API in
wgpu whereby binding numbers for binding arrays are taken by &u32
reference, not by u32 value.
Trait Implementations§
Source§impl Clone for BindlessResourceType
impl Clone for BindlessResourceType
Source§fn clone(&self) -> BindlessResourceType
fn clone(&self) -> BindlessResourceType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BindlessResourceType
impl Debug for BindlessResourceType
Source§impl From<SamplerBindingType> for BindlessResourceType
impl From<SamplerBindingType> for BindlessResourceType
Source§fn from(sampler_binding_type: SamplerBindingType) -> Self
fn from(sampler_binding_type: SamplerBindingType) -> Self
Source§impl From<TextureViewDimension> for BindlessResourceType
impl From<TextureViewDimension> for BindlessResourceType
Source§fn from(texture_view_dimension: TextureViewDimension) -> Self
fn from(texture_view_dimension: TextureViewDimension) -> Self
Source§impl Hash for BindlessResourceType
impl Hash for BindlessResourceType
Source§impl Ord for BindlessResourceType
impl Ord for BindlessResourceType
Source§fn cmp(&self, other: &BindlessResourceType) -> Ordering
fn cmp(&self, other: &BindlessResourceType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for BindlessResourceType
impl PartialEq for BindlessResourceType
Source§impl PartialOrd for BindlessResourceType
impl PartialOrd for BindlessResourceType
impl Copy for BindlessResourceType
impl Eq for BindlessResourceType
impl StructuralPartialEq for BindlessResourceType
Auto Trait Implementations§
impl Freeze for BindlessResourceType
impl RefUnwindSafe for BindlessResourceType
impl Send for BindlessResourceType
impl Sync for BindlessResourceType
impl Unpin for BindlessResourceType
impl UnwindSafe for BindlessResourceType
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§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>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§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.Source§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.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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