Struct vulkano::descriptor::descriptor::DescriptorDesc [−][src]
pub struct DescriptorDesc { pub ty: DescriptorDescTy, pub array_count: u32, pub stages: ShaderStages, pub readonly: bool, }
Contains the exact description of a single descriptor.
Note: You are free to fill a
DescriptorDesc
struct the way you want, but its validity will be checked when you create a pipeline layout, a descriptor set, or when you try to bind a descriptor set.
Fields
ty: DescriptorDescTy
Describes the content and layout of each array element of a descriptor.
array_count: u32
How many array elements this descriptor is made of. The value 0 is invalid and may trigger a panic depending on the situation.
stages: ShaderStages
Which shader stages are going to access this descriptor.
readonly: bool
True if the attachment is only ever read by the shader. False if it is also written.
Implementations
impl DescriptorDesc
[src]
impl DescriptorDesc
[src]pub fn is_superset_of(
&self,
other: &DescriptorDesc
) -> Result<(), DescriptorDescSupersetError>
[src]
pub fn is_superset_of(
&self,
other: &DescriptorDesc
) -> Result<(), DescriptorDescSupersetError>
[src]Checks whether we are a superset of another descriptor.
Returns true if self
is the same descriptor as other
, or if self
is the same as
other
but with a larger array elements count and/or more shader stages.
Example
use vulkano::descriptor::descriptor::DescriptorDesc; use vulkano::descriptor::descriptor::DescriptorDescTy::*; use vulkano::descriptor::descriptor::ShaderStages; let desc_super = DescriptorDesc{ ty: Sampler, array_count: 2, stages: ShaderStages{ vertex: true, tessellation_control: true, tessellation_evaluation: true, geometry: true, fragment: true, compute: true }, readonly: false }; let desc_sub = DescriptorDesc{ ty: Sampler, array_count: 1, stages: ShaderStages{ vertex: true, tessellation_control: false, tessellation_evaluation: false, geometry: false, fragment: true, compute: false }, readonly: true }; assert_eq!(desc_super.is_superset_of(&desc_sub).unwrap(), ());
pub fn union(&self, other: &DescriptorDesc) -> Option<DescriptorDesc>
[src]
pub fn union(&self, other: &DescriptorDesc) -> Option<DescriptorDesc>
[src]Builds a DescriptorDesc
that is the union of self
and other
, if possible.
The returned value will be a superset of both self
and other
.
Example
use vulkano::descriptor::descriptor::DescriptorDesc; use vulkano::descriptor::descriptor::DescriptorDescTy::*; use vulkano::descriptor::descriptor::ShaderStages; let desc_part1 = DescriptorDesc{ ty: Sampler, array_count: 2, stages: ShaderStages{ vertex: true, tessellation_control: true, tessellation_evaluation: false, geometry: true, fragment: false, compute: true }, readonly: false }; let desc_part2 = DescriptorDesc{ ty: Sampler, array_count: 1, stages: ShaderStages{ vertex: true, tessellation_control: false, tessellation_evaluation: true, geometry: false, fragment: true, compute: true }, readonly: true }; let desc_union = DescriptorDesc{ ty: Sampler, array_count: 2, stages: ShaderStages{ vertex: true, tessellation_control: true, tessellation_evaluation: true, geometry: true, fragment: true, compute: true }, readonly: false }; assert_eq!(desc_part1.union(&desc_part2), Some(desc_union));
pub fn pipeline_stages_and_access(&self) -> (PipelineStages, AccessFlags)
[src]
pub fn pipeline_stages_and_access(&self) -> (PipelineStages, AccessFlags)
[src]Returns the pipeline stages and access flags corresponding to the usage of this descriptor.
Panic
Panics if the type is Sampler
.
Trait Implementations
impl Clone for DescriptorDesc
[src]
impl Clone for DescriptorDesc
[src]fn clone(&self) -> DescriptorDesc
[src]
fn clone(&self) -> DescriptorDesc
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for DescriptorDesc
[src]
impl Debug for DescriptorDesc
[src]impl PartialEq<DescriptorDesc> for DescriptorDesc
[src]
impl PartialEq<DescriptorDesc> for DescriptorDesc
[src]fn eq(&self, other: &DescriptorDesc) -> bool
[src]
fn eq(&self, other: &DescriptorDesc) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &DescriptorDesc) -> bool
[src]
fn ne(&self, other: &DescriptorDesc) -> bool
[src]This method tests for !=
.
impl StructuralPartialEq for DescriptorDesc
[src]
Auto Trait Implementations
impl RefUnwindSafe for DescriptorDesc
impl Send for DescriptorDesc
impl Sync for DescriptorDesc
impl Unpin for DescriptorDesc
impl UnwindSafe for DescriptorDesc
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Content for T
[src]
impl<T> Content for T
[src]pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]
pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]Builds a pointer to this type from a raw pointer.
pub fn is_size_suitable(usize) -> bool
[src]
pub fn is_size_suitable(usize) -> bool
[src]Returns true if the size is suitable to store a type like this.
pub fn indiv_size() -> usize
[src]
pub fn indiv_size() -> usize
[src]Returns the size of an individual element.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more