Struct vulkano::descriptor_set::layout::DescriptorSetLayoutBinding
source · [−]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
sourceimpl DescriptorSetLayoutBinding
impl DescriptorSetLayoutBinding
sourcepub fn descriptor_type(descriptor_type: DescriptorType) -> Self
pub fn descriptor_type(descriptor_type: DescriptorType) -> Self
Returns a DescriptorSetLayoutBinding
with the given type.
sourcepub fn ensure_compatible_with_shader(
&self,
descriptor_requirements: &DescriptorRequirements
) -> Result<(), DescriptorRequirementsNotMet>
pub fn ensure_compatible_with_shader(
&self,
descriptor_requirements: &DescriptorRequirements
) -> Result<(), DescriptorRequirementsNotMet>
Checks whether the descriptor of a pipeline layout self
is compatible with the
requirements of a shader other
.
Trait Implementations
sourceimpl Clone for DescriptorSetLayoutBinding
impl Clone for DescriptorSetLayoutBinding
sourcefn clone(&self) -> DescriptorSetLayoutBinding
fn clone(&self) -> DescriptorSetLayoutBinding
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for DescriptorSetLayoutBinding
impl Debug for DescriptorSetLayoutBinding
sourceimpl From<&'_ DescriptorRequirements> for DescriptorSetLayoutBinding
impl From<&'_ DescriptorRequirements> for DescriptorSetLayoutBinding
sourcefn from(reqs: &DescriptorRequirements) -> Self
fn from(reqs: &DescriptorRequirements) -> Self
Performs the conversion.
sourceimpl PartialEq<DescriptorSetLayoutBinding> for DescriptorSetLayoutBinding
impl PartialEq<DescriptorSetLayoutBinding> for DescriptorSetLayoutBinding
sourcefn eq(&self, other: &DescriptorSetLayoutBinding) -> bool
fn eq(&self, other: &DescriptorSetLayoutBinding) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &DescriptorSetLayoutBinding) -> bool
fn ne(&self, other: &DescriptorSetLayoutBinding) -> bool
This method tests for !=
.
impl Eq for DescriptorSetLayoutBinding
impl StructuralEq for DescriptorSetLayoutBinding
impl StructuralPartialEq for DescriptorSetLayoutBinding
Auto Trait Implementations
impl RefUnwindSafe for DescriptorSetLayoutBinding
impl Send for DescriptorSetLayoutBinding
impl Sync for DescriptorSetLayoutBinding
impl Unpin for DescriptorSetLayoutBinding
impl UnwindSafe for DescriptorSetLayoutBinding
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more