pub struct ImmutableImage<A = PotentialDedicatedAllocation<StandardMemoryPoolAlloc>> { /* private fields */ }
Expand description
Image whose purpose is to be used for read-only purposes. You can write to the image once, but then you must only ever read from it.
Implementations
sourceimpl ImmutableImage
impl ImmutableImage
pub fn new(
device: Arc<Device>,
dimensions: ImageDimensions,
format: Format,
queue_family_indices: impl IntoIterator<Item = u32>
) -> Result<Arc<ImmutableImage>, ImmutableImageCreationError>
👎Deprecated:
use ImmutableImage::uninitialized instead
pub fn with_mipmaps(
device: Arc<Device>,
dimensions: ImageDimensions,
format: Format,
mip_levels: impl Into<MipmapsCount>,
queue_family_indices: impl IntoIterator<Item = u32>
) -> Result<Arc<ImmutableImage>, ImmutableImageCreationError>
👎Deprecated:
use ImmutableImage::uninitialized instead
sourcepub fn uninitialized(
device: Arc<Device>,
dimensions: ImageDimensions,
format: Format,
mip_levels: impl Into<MipmapsCount>,
usage: ImageUsage,
flags: ImageCreateFlags,
layout: ImageLayout,
queue_family_indices: impl IntoIterator<Item = u32>
) -> Result<(Arc<ImmutableImage>, Arc<ImmutableImageInitialization>), ImmutableImageCreationError>
pub fn uninitialized(
device: Arc<Device>,
dimensions: ImageDimensions,
format: Format,
mip_levels: impl Into<MipmapsCount>,
usage: ImageUsage,
flags: ImageCreateFlags,
layout: ImageLayout,
queue_family_indices: impl IntoIterator<Item = u32>
) -> Result<(Arc<ImmutableImage>, Arc<ImmutableImageInitialization>), ImmutableImageCreationError>
Builds an uninitialized immutable image.
Returns two things: the image, and a special access that should be used for the initial upload to the image.
sourcepub fn from_iter<Px, I>(
iter: I,
dimensions: ImageDimensions,
mip_levels: MipmapsCount,
format: Format,
queue: Arc<Queue>
) -> Result<(Arc<Self>, CommandBufferExecFuture<NowFuture, PrimaryAutoCommandBuffer>), ImmutableImageCreationError>where
[Px]: BufferContents,
I: IntoIterator<Item = Px>,
I::IntoIter: ExactSizeIterator,
pub fn from_iter<Px, I>(
iter: I,
dimensions: ImageDimensions,
mip_levels: MipmapsCount,
format: Format,
queue: Arc<Queue>
) -> Result<(Arc<Self>, CommandBufferExecFuture<NowFuture, PrimaryAutoCommandBuffer>), ImmutableImageCreationError>where
[Px]: BufferContents,
I: IntoIterator<Item = Px>,
I::IntoIter: ExactSizeIterator,
Construct an ImmutableImage from the contents of iter
.
sourcepub fn from_buffer(
source: Arc<dyn BufferAccess>,
dimensions: ImageDimensions,
mip_levels: MipmapsCount,
format: Format,
queue: Arc<Queue>
) -> Result<(Arc<Self>, CommandBufferExecFuture<NowFuture, PrimaryAutoCommandBuffer>), ImmutableImageCreationError>
pub fn from_buffer(
source: Arc<dyn BufferAccess>,
dimensions: ImageDimensions,
mip_levels: MipmapsCount,
format: Format,
queue: Arc<Queue>
) -> Result<(Arc<Self>, CommandBufferExecFuture<NowFuture, PrimaryAutoCommandBuffer>), ImmutableImageCreationError>
Construct an ImmutableImage containing a copy of the data in source
.
Trait Implementations
sourceimpl<A: Debug> Debug for ImmutableImage<A>
impl<A: Debug> Debug for ImmutableImage<A>
sourceimpl<A> DeviceOwned for ImmutableImage<A>
impl<A> DeviceOwned for ImmutableImage<A>
sourceimpl<A> Hash for ImmutableImage<A>where
A: MemoryPoolAlloc,
impl<A> Hash for ImmutableImage<A>where
A: MemoryPoolAlloc,
sourceimpl<A> ImageAccess for ImmutableImage<A>where
A: MemoryPoolAlloc,
impl<A> ImageAccess for ImmutableImage<A>where
A: MemoryPoolAlloc,
sourcefn inner(&self) -> ImageInner<'_>
fn inner(&self) -> ImageInner<'_>
Returns the inner unsafe image object used by this image.
fn is_layout_initialized(&self) -> bool
sourcefn initial_layout_requirement(&self) -> ImageLayout
fn initial_layout_requirement(&self) -> ImageLayout
Returns the layout that the image has when it is first used in a primary command buffer. Read more
sourcefn final_layout_requirement(&self) -> ImageLayout
fn final_layout_requirement(&self) -> ImageLayout
Returns the layout that the image must be returned to before the end of the command buffer. Read more
sourcefn descriptor_layouts(&self) -> Option<ImageDescriptorLayouts>
fn descriptor_layouts(&self) -> Option<ImageDescriptorLayouts>
Returns an
ImageDescriptorLayouts
structure specifying the image layout to use
in descriptors of various kinds. Read moresourcefn dimensions(&self) -> ImageDimensions
fn dimensions(&self) -> ImageDimensions
Returns the dimensions of the image.
sourcefn format_features(&self) -> &FormatFeatures
fn format_features(&self) -> &FormatFeatures
Returns the features supported by the image’s format.
sourcefn mip_levels(&self) -> u32
fn mip_levels(&self) -> u32
Returns the number of mipmap levels of this image.
sourcefn samples(&self) -> SampleCount
fn samples(&self) -> SampleCount
Returns the number of samples of this image.
sourcefn usage(&self) -> &ImageUsage
fn usage(&self) -> &ImageUsage
Returns the usage the image was created with.
sourcefn stencil_usage(&self) -> &ImageUsage
fn stencil_usage(&self) -> &ImageUsage
Returns the stencil usage the image was created with.
sourcefn subresource_layers(&self) -> ImageSubresourceLayers
fn subresource_layers(&self) -> ImageSubresourceLayers
Returns an
ImageSubresourceLayers
covering the first mip level of the image. All aspects
of the image are selected, or plane0
if the image is multi-planar. Read moresourcefn subresource_range(&self) -> ImageSubresourceRange
fn subresource_range(&self) -> ImageSubresourceRange
Returns an
ImageSubresourceRange
covering the whole image. If the image is multi-planar,
only the color
aspect is selected. Read moresourceunsafe fn layout_initialized(&self)
unsafe fn layout_initialized(&self)
When images are created their memory layout is initially
Undefined
or Preinitialized
.
This method allows the image memory barrier creation process to signal when an image
has been transitioned out of its initial Undefined
or Preinitialized
state. This
allows vulkano to avoid creating unnecessary image memory barriers between future
uses of the image. Read morefn initial_layout(&self) -> ImageLayout
sourceunsafe fn forced_undefined_initial_layout(
self,
preinitialized: bool
) -> Arc<ImageAccessFromUndefinedLayout<Self>>where
Self: Sized,
unsafe fn forced_undefined_initial_layout(
self,
preinitialized: bool
) -> Arc<ImageAccessFromUndefinedLayout<Self>>where
Self: Sized,
Wraps around this
ImageAccess
and returns an identical ImageAccess
but whose initial
layout requirement is either Undefined
or Preinitialized
. Read moresourceimpl<P, A> ImageContent<P> for ImmutableImage<A>where
A: MemoryPoolAlloc,
impl<P, A> ImageContent<P> for ImmutableImage<A>where
A: MemoryPoolAlloc,
sourcefn matches_format(&self) -> bool
fn matches_format(&self) -> bool
Checks whether pixels of type
P
match the format of the image.sourceimpl<A> PartialEq<ImmutableImage<A>> for ImmutableImage<A>where
A: MemoryPoolAlloc,
impl<A> PartialEq<ImmutableImage<A>> for ImmutableImage<A>where
A: MemoryPoolAlloc,
impl<A> Eq for ImmutableImage<A>where
A: MemoryPoolAlloc,
Auto Trait Implementations
impl<A = PotentialDedicatedAllocation<StandardMemoryPoolAlloc>> !RefUnwindSafe for ImmutableImage<A>
impl<A> Send for ImmutableImage<A>where
A: Send,
impl<A> Sync for ImmutableImage<A>where
A: Sync,
impl<A> Unpin for ImmutableImage<A>where
A: Unpin,
impl<A = PotentialDedicatedAllocation<StandardMemoryPoolAlloc>> !UnwindSafe for ImmutableImage<A>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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