logo
pub struct DescriptorSetLayoutBinding {
    pub descriptor_type: DescriptorType,
    pub descriptor_count: u32,
    pub variable_descriptor_count: bool,
    pub stages: ShaderStages,
    pub immutable_samplers: Vec<Arc<Sampler>>,
    pub _ne: NonExhaustive,
}
Expand description

A binding in a descriptor set layout.

Fields

descriptor_type: DescriptorType

The content and layout of each array element of a binding.

There is no default value.

descriptor_count: u32

How many descriptors (array elements) this binding is made of.

If the binding is a single element rather than an array, then you must specify 1.

The default value is 1.

variable_descriptor_count: bool

Whether the binding has a variable number of descriptors.

If set to true, the descriptor_binding_variable_descriptor_count feature must be enabled. The value of descriptor_count specifies the maximum number of descriptors allowed.

There may only be one binding with a variable count in a descriptor set, and it must be the binding with the highest binding number. The descriptor_type must not be DescriptorType::UniformBufferDynamic or DescriptorType::StorageBufferDynamic.

The default value is false.

stages: ShaderStages

Which shader stages are going to access the descriptors in this binding.

The default value is ShaderStages::none(), which must be overridden.

immutable_samplers: Vec<Arc<Sampler>>

Samplers that are included as a fixed part of the descriptor set layout. Once bound, they do not need to be provided when creating a descriptor set.

The list must be either empty, or contain exactly descriptor_count samplers. It can only be non-empty if descriptor_type is DescriptorType::Sampler or DescriptorType::CombinedImageSampler. If any of the samplers has an attached sampler YCbCr conversion, then only DescriptorType::CombinedImageSampler is allowed.

The default value is empty.

_ne: NonExhaustive

Implementations

Returns a DescriptorSetLayoutBinding with the given type.

Checks whether the descriptor of a pipeline layout self is compatible with the requirements of a shader other.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.