pub struct BindGroupLayoutEntry {
pub binding: u32,
pub visibility: ShaderStages,
pub buffer: Option<BufferBindingLayout>,
pub sampler: Option<SamplerBindingLayout>,
pub texture: Option<TextureBindingLayout>,
pub storage_texture: Option<StorageTextureBindingLayout>,
pub external_texture: Option<ExternalTextureBindingLayout>,
pub acceleration_structure: Option<AccelerationStructureBindingLayout>,
pub count: Option<NonZeroU32>,
}Expand description
Describes a single binding inside a bind group.
Corresponds to WebGPU GPUBindGroupLayoutEntry.
Fields§
§binding: u32Binding index. Must match shader index and be unique inside a BindGroupLayout. A binding
of index 1, would be described as @group(0) @binding(1) in shaders.
visibility: ShaderStagesWhich shader stages can see this binding.
buffer: Option<BufferBindingLayout>§sampler: Option<SamplerBindingLayout>§texture: Option<TextureBindingLayout>§storage_texture: Option<StorageTextureBindingLayout>§external_texture: Option<ExternalTextureBindingLayout>§acceleration_structure: Option<AccelerationStructureBindingLayout>§count: Option<NonZeroU32>If the binding is an array of multiple resources. Corresponds to binding_array<T> in the shader.
When this is Some the following validation applies:
- Count must be of value 1 or greater, this corresponds to the length of the array of resources that will be bound.
- When
ty == BindingType::Texture,wgt::Features::TEXTURE_BINDING_ARRAYmust be supported. - When
ty == BindingType::Sampler,wgt::Features::TEXTURE_BINDING_ARRAYmust be supported. - When
ty == BindingType::Buffer,wgt::Features::BUFFER_BINDING_ARRAYmust be supported. - When
ty == BindingType::Bufferandty.ty == BufferBindingType::Storage,wgt::Features::STORAGE_RESOURCE_BINDING_ARRAYmust be supported. - When
ty == BindingType::StorageTexture,wgt::Features::STORAGE_RESOURCE_BINDING_ARRAYmust be supported. - When any binding in the group is an array, no
BindingType::Bufferin the group may havehas_dynamic_offset == true - When any binding in the group is an array, no
BindingType::Bufferin the group may havety.ty == BufferBindingType::Uniform. - If
wgt::Features::PARTIALLY_BOUND_BINDING_ARRAYis enabled, the specified count becomes the upper bound instead.
Trait Implementations§
Source§impl Clone for BindGroupLayoutEntry
impl Clone for BindGroupLayoutEntry
Source§fn clone(&self) -> BindGroupLayoutEntry
fn clone(&self) -> BindGroupLayoutEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BindGroupLayoutEntry
impl Debug for BindGroupLayoutEntry
Source§impl<'de> Deserialize<'de> for BindGroupLayoutEntry
impl<'de> Deserialize<'de> for BindGroupLayoutEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<BindGroupLayoutEntry> for BindGroupLayoutEntry
impl From<BindGroupLayoutEntry> for BindGroupLayoutEntry
Source§fn from(val: BindGroupLayoutEntry) -> Self
fn from(val: BindGroupLayoutEntry) -> Self
Converts to this type from the input type.
Source§impl Hash for BindGroupLayoutEntry
impl Hash for BindGroupLayoutEntry
Source§impl PartialEq for BindGroupLayoutEntry
impl PartialEq for BindGroupLayoutEntry
Source§impl Serialize for BindGroupLayoutEntry
impl Serialize for BindGroupLayoutEntry
Source§impl TryInto<BindGroupLayoutEntry> for BindGroupLayoutEntry
impl TryInto<BindGroupLayoutEntry> for BindGroupLayoutEntry
Source§type Error = CreateBindGroupLayoutError
type Error = CreateBindGroupLayoutError
The type returned in the event of a conversion error.
impl Copy for BindGroupLayoutEntry
impl Eq for BindGroupLayoutEntry
impl StructuralPartialEq for BindGroupLayoutEntry
Auto Trait Implementations§
impl Freeze for BindGroupLayoutEntry
impl RefUnwindSafe for BindGroupLayoutEntry
impl Send for BindGroupLayoutEntry
impl Sync for BindGroupLayoutEntry
impl Unpin for BindGroupLayoutEntry
impl UnsafeUnpin for BindGroupLayoutEntry
impl UnwindSafe for BindGroupLayoutEntry
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
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>
Converts
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>
Converts
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