pub struct ImmutableImage { /* 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
sourcepub fn uninitialized(
allocator: &impl MemoryAllocator + ?Sized,
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(
allocator: &impl MemoryAllocator + ?Sized,
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, L, A>(
allocator: &impl MemoryAllocator + ?Sized,
iter: I,
dimensions: ImageDimensions,
mip_levels: MipmapsCount,
format: Format,
command_buffer_builder: &mut AutoCommandBufferBuilder<L, A>
) -> Result<Arc<Self>, ImmutableImageCreationError>where
[Px]: BufferContents,
I: IntoIterator<Item = Px>,
I::IntoIter: ExactSizeIterator,
A: CommandBufferAllocator,
pub fn from_iter<Px, I, L, A>(
allocator: &impl MemoryAllocator + ?Sized,
iter: I,
dimensions: ImageDimensions,
mip_levels: MipmapsCount,
format: Format,
command_buffer_builder: &mut AutoCommandBufferBuilder<L, A>
) -> Result<Arc<Self>, ImmutableImageCreationError>where
[Px]: BufferContents,
I: IntoIterator<Item = Px>,
I::IntoIter: ExactSizeIterator,
A: CommandBufferAllocator,
Construct an ImmutableImage from the contents of iter
.
This is a convenience function, equivalent to creating a CpuAccessibleBuffer
, writing
iter
to it, then calling from_buffer
to copy the data
over.
sourcepub fn from_buffer<L, A>(
allocator: &impl MemoryAllocator + ?Sized,
source: Arc<dyn BufferAccess>,
dimensions: ImageDimensions,
mip_levels: MipmapsCount,
format: Format,
command_buffer_builder: &mut AutoCommandBufferBuilder<L, A>
) -> Result<Arc<Self>, ImmutableImageCreationError>where
A: CommandBufferAllocator,
pub fn from_buffer<L, A>(
allocator: &impl MemoryAllocator + ?Sized,
source: Arc<dyn BufferAccess>,
dimensions: ImageDimensions,
mip_levels: MipmapsCount,
format: Format,
command_buffer_builder: &mut AutoCommandBufferBuilder<L, A>
) -> Result<Arc<Self>, ImmutableImageCreationError>where
A: CommandBufferAllocator,
Construct an ImmutableImage containing a copy of the data in source
.
This is a convenience function, equivalent to calling
uninitialized
with the queue family index of
command_buffer_builder
, then recording a copy_buffer_to_image
command to
command_buffer_builder
.
command_buffer_builder
can then be used to record other commands, built, and executed as
normal. If it is not executed, the image contents will be left undefined.
Trait Implementations
sourceimpl Debug for ImmutableImage
impl Debug for ImmutableImage
sourceimpl DeviceOwned for ImmutableImage
impl DeviceOwned for ImmutableImage
sourceimpl Hash for ImmutableImage
impl Hash for ImmutableImage
sourceimpl ImageAccess for ImmutableImage
impl ImageAccess for ImmutableImage
sourcefn inner(&self) -> ImageInner<'_>
fn inner(&self) -> ImageInner<'_>
fn is_layout_initialized(&self) -> bool
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 descriptor_layouts(&self) -> Option<ImageDescriptorLayouts>
fn descriptor_layouts(&self) -> Option<ImageDescriptorLayouts>
ImageDescriptorLayouts
structure specifying the image layout to use
in descriptors of various kinds. Read moresourcefn dimensions(&self) -> ImageDimensions
fn dimensions(&self) -> ImageDimensions
sourcefn format_features(&self) -> &FormatFeatures
fn format_features(&self) -> &FormatFeatures
sourcefn mip_levels(&self) -> u32
fn mip_levels(&self) -> u32
sourcefn samples(&self) -> SampleCount
fn samples(&self) -> SampleCount
sourcefn usage(&self) -> &ImageUsage
fn usage(&self) -> &ImageUsage
sourcefn stencil_usage(&self) -> &ImageUsage
fn stencil_usage(&self) -> &ImageUsage
sourcefn subresource_layers(&self) -> ImageSubresourceLayers
fn subresource_layers(&self) -> ImageSubresourceLayers
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
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)
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,
ImageAccess
and returns an identical ImageAccess
but whose initial
layout requirement is either Undefined
or Preinitialized
. Read moresourceimpl<P> ImageContent<P> for ImmutableImage
impl<P> ImageContent<P> for ImmutableImage
sourcefn matches_format(&self) -> bool
fn matches_format(&self) -> bool
P
match the format of the image.