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,
}
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, a panic will happen.
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.
Fields
transfer_src: bool
Can be used as a source for transfers. Includes blits.
transfer_dst: bool
Can be used as a destination for transfers. Includes blits.
sampled: bool
Can be sampled from a shader.
storage: bool
Can be used as an image storage in a shader.
color_attachment: bool
Can be attached as a color attachment to a framebuffer.
depth_stencil_attachment: bool
Can be attached as a depth, stencil or depth-stencil attachment to a framebuffer.
transient_attachment: bool
Indicates that this image will only ever be used as a temporary framebuffer attachment. 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.
input_attachment: bool
Can be used as an input attachment. In other words, you can draw to it in a subpass then read from it in a following pass.
Implementations
sourceimpl ImageUsage
impl ImageUsage
sourcepub const fn all() -> ImageUsage
pub const fn all() -> ImageUsage
Builds a ImageUsage
with all values set to true. Note that using the returned value will
produce an error because of transient_attachment
being true.
sourcepub const fn none() -> ImageUsage
pub const fn none() -> ImageUsage
Builds a ImageUsage
with all values set to false. Useful as a default value.
Example
use vulkano::image::ImageUsage as ImageUsage;
let _usage = ImageUsage {
transfer_dst: true,
sampled: true,
.. ImageUsage::none()
};
sourcepub const fn color_attachment() -> ImageUsage
pub const fn color_attachment() -> ImageUsage
Builds a ImageUsage with color_attachment set to true and the rest to false.
sourcepub const fn depth_stencil_attachment() -> ImageUsage
pub const fn depth_stencil_attachment() -> ImageUsage
Builds a ImageUsage with depth_stencil_attachment set to true and the rest to false.
sourcepub const fn transient_color_attachment() -> ImageUsage
pub const fn transient_color_attachment() -> ImageUsage
Builds a ImageUsage with color_attachment and transient_attachment set to true and the rest to false.
sourcepub const fn transient_depth_stencil_attachment() -> ImageUsage
pub const fn transient_depth_stencil_attachment() -> ImageUsage
Builds a ImageUsage with depth_stencil_attachment and transient_attachment set to true and the rest to false.
sourcepub const fn transient_input_attachment() -> ImageUsage
pub const fn transient_input_attachment() -> ImageUsage
Builds a ImageUsage with input_attachment and transient_attachment set to true and the rest to false.
Trait Implementations
sourceimpl BitOr<ImageUsage> for ImageUsage
impl BitOr<ImageUsage> for ImageUsage
type Output = ImageUsage
type Output = ImageUsage
The resulting type after applying the |
operator.
sourceimpl Clone for ImageUsage
impl Clone for ImageUsage
sourcefn clone(&self) -> ImageUsage
fn clone(&self) -> ImageUsage
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 ImageUsage
impl Debug for ImageUsage
sourceimpl From<ImageUsage> for ImageUsageFlags
impl From<ImageUsage> for ImageUsageFlags
sourcefn from(val: ImageUsage) -> Self
fn from(val: ImageUsage) -> Self
Converts to this type from the input type.
sourceimpl From<ImageUsageFlags> for ImageUsage
impl From<ImageUsageFlags> for ImageUsage
sourcefn from(val: ImageUsageFlags) -> ImageUsage
fn from(val: ImageUsageFlags) -> ImageUsage
Converts to this type from the input type.
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ImageUsage) -> bool
fn ne(&self, other: &ImageUsage) -> bool
This method tests for !=
.
impl Copy for ImageUsage
impl Eq for ImageUsage
impl StructuralEq for ImageUsage
impl StructuralPartialEq for ImageUsage
Auto Trait Implementations
impl RefUnwindSafe for ImageUsage
impl Send for ImageUsage
impl Sync for ImageUsage
impl Unpin for ImageUsage
impl UnwindSafe for ImageUsage
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