Struct vulkano::image::ImageUsage
source · pub struct ImageUsage {
pub transfer_src: bool,
pub transfer_dst: bool,
pub sampled: bool,
pub storage: bool,
pub color_attachment: bool,
pub depth_stencil_attachment: bool,
pub transient_attachment: bool,
pub input_attachment: bool,
pub _ne: NonExhaustive,
}
Expand description
Describes how an image is going to be used. This is not just an optimization.
If you try to use an image in a way that you didn’t declare, an error will occur.
Fields
transfer_src: bool
The image can be used as a source for transfer, blit, resolve and clear commands.
transfer_dst: bool
The image can be used as a destination for transfer, blit, resolve and clear commands.
sampled: bool
The image can be used as a sampled image in a shader.
storage: bool
The image can be used as a storage image in a shader.
color_attachment: bool
The image can be used as a color attachment in a render pass/framebuffer.
depth_stencil_attachment: bool
The image can be used as a depth/stencil attachment in a render pass/framebuffer.
transient_attachment: bool
The image will be used as an attachment, and will only ever be used temporarily. As soon as you leave a render pass, the content of transient images becomes undefined.
This is a hint to the Vulkan implementation that it may not need allocate any memory for this image if the image can live entirely in some cache.
If transient_attachment
is true, then only color_attachment
, depth_stencil_attachment
and input_attachment
can be true as well. The rest must be false or an error will be
returned when creating the image.
input_attachment: bool
The image can be used as an input attachment in a render pass/framebuffer.
_ne: NonExhaustive
Implementations
sourceimpl ImageUsage
impl ImageUsage
sourcepub const fn none() -> Self
👎Deprecated since 0.31.0: Use empty
instead.
pub const fn none() -> Self
empty
instead.Returns a ImageUsage
with none of the flags set.
sourcepub const fn intersects(&self, other: &Self) -> bool
pub const fn intersects(&self, other: &Self) -> bool
Returns whether any flags are set in both self
and other
.
sourcepub const fn contains(&self, other: &Self) -> bool
pub const fn contains(&self, other: &Self) -> bool
Returns whether all flags in other
are set in self
.
sourcepub const fn intersection(&self, other: &Self) -> Self
pub const fn intersection(&self, other: &Self) -> Self
Returns the intersection of self
and other
.
sourcepub const fn difference(&self, other: &Self) -> Self
pub const fn difference(&self, other: &Self) -> Self
Returns self
without the flags set in other
.
sourcepub const fn symmetric_difference(&self, other: &Self) -> Self
pub const fn symmetric_difference(&self, other: &Self) -> Self
Returns the flags set in self
or other
, but not both.
Trait Implementations
sourceimpl BitAnd<ImageUsage> for ImageUsage
impl BitAnd<ImageUsage> for ImageUsage
type Output = ImageUsage
type Output = ImageUsage
&
operator.sourceimpl BitAndAssign<ImageUsage> for ImageUsage
impl BitAndAssign<ImageUsage> for ImageUsage
sourcefn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&=
operation. Read moresourceimpl BitOr<ImageUsage> for ImageUsage
impl BitOr<ImageUsage> for ImageUsage
type Output = ImageUsage
type Output = ImageUsage
|
operator.sourceimpl BitOrAssign<ImageUsage> for ImageUsage
impl BitOrAssign<ImageUsage> for ImageUsage
sourcefn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|=
operation. Read moresourceimpl BitXor<ImageUsage> for ImageUsage
impl BitXor<ImageUsage> for ImageUsage
type Output = ImageUsage
type Output = ImageUsage
^
operator.sourceimpl BitXorAssign<ImageUsage> for ImageUsage
impl BitXorAssign<ImageUsage> for ImageUsage
sourcefn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^=
operation. Read moresourceimpl Clone for ImageUsage
impl Clone for ImageUsage
sourcefn clone(&self) -> ImageUsage
fn clone(&self) -> ImageUsage
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for ImageUsage
impl Debug for ImageUsage
sourceimpl Default for ImageUsage
impl Default for ImageUsage
sourceimpl From<ImageUsage> for ImageUsageFlags
impl From<ImageUsage> for ImageUsageFlags
sourcefn from(val: ImageUsage) -> Self
fn from(val: ImageUsage) -> Self
sourceimpl From<ImageUsageFlags> for ImageUsage
impl From<ImageUsageFlags> for ImageUsage
sourcefn from(val: ImageUsageFlags) -> Self
fn from(val: ImageUsageFlags) -> Self
sourceimpl Hash for ImageUsage
impl Hash for ImageUsage
sourceimpl PartialEq<ImageUsage> for ImageUsage
impl PartialEq<ImageUsage> for ImageUsage
sourcefn eq(&self, other: &ImageUsage) -> bool
fn eq(&self, other: &ImageUsage) -> bool
sourceimpl Sub<ImageUsage> for ImageUsage
impl Sub<ImageUsage> for ImageUsage
type Output = ImageUsage
type Output = ImageUsage
-
operator.sourceimpl SubAssign<ImageUsage> for ImageUsage
impl SubAssign<ImageUsage> for ImageUsage
sourcefn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-=
operation. Read more