Struct vulkano::image::swapchain::SwapchainImage
source · pub struct SwapchainImage<W> { /* private fields */ }
Expand description
An image that is part of a swapchain.
Creating a SwapchainImage
is automatically done when creating a swapchain.
A swapchain image is special in the sense that it can only be used after being acquired by
calling the acquire
method on the swapchain. You have no way to know in advance which
swapchain image is going to be acquired, so you should keep all of them alive.
After a swapchain image has been acquired, you are free to perform all the usual operations on it. When you are done you can then present the image (by calling the corresponding method on the swapchain), which will have the effect of showing the content of the image to the screen. Once an image has been presented, it can no longer be used unless it is acquired again.
Implementations
sourceimpl<W> SwapchainImage<W>
impl<W> SwapchainImage<W>
sourcepub unsafe fn from_raw(
swapchain: Arc<Swapchain<W>>,
id: usize
) -> Result<Arc<SwapchainImage<W>>, OomError>
pub unsafe fn from_raw(
swapchain: Arc<Swapchain<W>>,
id: usize
) -> Result<Arc<SwapchainImage<W>>, OomError>
Builds a SwapchainImage
from raw components.
This is an internal method that you shouldn’t call.
sourcepub fn dimensions(&self) -> [u32; 2]
pub fn dimensions(&self) -> [u32; 2]
Returns the dimensions of the image.
A SwapchainImage
is always two-dimensional.
Trait Implementations
sourceimpl<W> ImageAccess for SwapchainImage<W>
impl<W> ImageAccess for SwapchainImage<W>
sourcefn inner(&self) -> ImageInner<'_>
fn inner(&self) -> ImageInner<'_>
sourcefn initial_layout_requirement(&self) -> ImageLayout
fn initial_layout_requirement(&self) -> ImageLayout
sourcefn final_layout_requirement(&self) -> ImageLayout
fn final_layout_requirement(&self) -> ImageLayout
sourcefn conflicts_buffer(&self, other: &dyn BufferAccess) -> bool
fn conflicts_buffer(&self, other: &dyn BufferAccess) -> bool
self
potentially overlaps the same memory as an
access to other
. Read moresourcefn conflicts_image(&self, other: &dyn ImageAccess) -> bool
fn conflicts_image(&self, other: &dyn ImageAccess) -> bool
self
potentially overlaps the same memory as an
access to other
. Read moresourcefn conflict_key(&self) -> u64
fn conflict_key(&self) -> u64
sourcefn try_gpu_lock(&self, _: bool, _: ImageLayout) -> Result<(), AccessError>
fn try_gpu_lock(&self, _: bool, _: ImageLayout) -> Result<(), AccessError>
sourceunsafe fn increase_gpu_lock(&self)
unsafe fn increase_gpu_lock(&self)
sourceunsafe fn unlock(&self, _: Option<ImageLayout>)
unsafe fn unlock(&self, _: Option<ImageLayout>)
sourcefn has_depth(&self) -> bool
fn has_depth(&self) -> bool
sourcefn has_stencil(&self) -> bool
fn has_stencil(&self) -> bool
sourcefn mipmap_levels(&self) -> u32
fn mipmap_levels(&self) -> u32
sourcefn dimensions(&self) -> ImageDimensions
fn dimensions(&self) -> ImageDimensions
sourcefn supports_blit_source(&self) -> bool
fn supports_blit_source(&self) -> bool
sourcefn supports_blit_destination(&self) -> bool
fn supports_blit_destination(&self) -> bool
sourceunsafe fn forced_undefined_initial_layout(
self,
preinitialized: bool
) -> ImageAccessFromUndefinedLayout<Self>where
Self: Sized,
unsafe fn forced_undefined_initial_layout(
self,
preinitialized: bool
) -> ImageAccessFromUndefinedLayout<Self>where
Self: Sized,
ImageAccess
and returns an identical ImageAccess
but whose initial
layout requirement is either Undefined
or Preinitialized
. Read moresourceimpl<W> ImageClearValue<<Format as FormatDesc>::ClearValue> for SwapchainImage<W>
impl<W> ImageClearValue<<Format as FormatDesc>::ClearValue> for SwapchainImage<W>
fn decode(&self, value: <Format as FormatDesc>::ClearValue) -> Option<ClearValue>
sourceimpl<P, W> ImageContent<P> for SwapchainImage<W>
impl<P, W> ImageContent<P> for SwapchainImage<W>
sourcefn matches_format(&self) -> bool
fn matches_format(&self) -> bool
P
match the format of the image.