pub struct DescriptorBindingRequirements {
    pub descriptor_types: Vec<DescriptorType>,
    pub descriptor_count: Option<u32>,
    pub image_format: Option<Format>,
    pub image_multisampled: bool,
    pub image_scalar_type: Option<NumericType>,
    pub image_view_type: Option<ImageViewType>,
    pub stages: ShaderStages,
    pub descriptors: HashMap<Option<u32>, DescriptorRequirements>,
}
Expand description

The requirements imposed by a shader on a binding within a descriptor set layout, and on any resource that is bound to that binding.

Fields§

§descriptor_types: Vec<DescriptorType>

The descriptor types that are allowed.

§descriptor_count: Option<u32>

The number of descriptors (array elements) that the shader requires. The descriptor set layout can declare more than this, but never less.

None means that the shader declares this as a runtime-sized array, and could potentially access every array element provided in the descriptor set.

§image_format: Option<Format>

The image format that is required for image views bound to this binding. If this is None, then any image format is allowed.

§image_multisampled: bool

Whether image views bound to this binding must have multisampling enabled or disabled.

§image_scalar_type: Option<NumericType>

The base scalar type required for the format of image views bound to this binding. This is None for non-image bindings.

§image_view_type: Option<ImageViewType>

The view type that is required for image views bound to this binding. This is None for non-image bindings.

§stages: ShaderStages

The shader stages that the binding must be declared for.

§descriptors: HashMap<Option<u32>, DescriptorRequirements>

The requirements for individual descriptors within a binding.

Keys with Some hold requirements for a specific descriptor index, if it is statically known in the shader (a constant). The key None holds requirements for indices that are not statically known, but determined only at runtime (calculated from an input variable).

Implementations§

source§

impl DescriptorBindingRequirements

source

pub fn merge(&mut self, other: &Self) -> Result<(), Box<ValidationError>>

Merges other into self, so that self satisfies the requirements of both. An error is returned if the requirements conflict.

Trait Implementations§

source§

impl Clone for DescriptorBindingRequirements

source§

fn clone(&self) -> DescriptorBindingRequirements

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DescriptorBindingRequirements

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for DescriptorBindingRequirements

source§

fn default() -> DescriptorBindingRequirements

Returns the “default value” for a type. Read more
source§

impl From<&DescriptorBindingRequirements> for DescriptorSetLayoutBinding

source§

fn from(reqs: &DescriptorBindingRequirements) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.