Struct vulkano::image::immutable::ImmutableImage [−][src]
pub struct ImmutableImage<A = PotentialDedicatedAllocation<StdMemoryPoolAlloc>> { /* fields omitted */ }
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
pub fn new<'a, I>(
device: Arc<Device>,
dimensions: ImageDimensions,
format: Format,
queue_families: I
) -> Result<Arc<ImmutableImage>, ImageCreationError> where
I: IntoIterator<Item = QueueFamily<'a>>,
use ImmutableImage::uninitialized instead
pub fn with_mipmaps<'a, I, M>(
device: Arc<Device>,
dimensions: ImageDimensions,
format: Format,
mipmaps: M,
queue_families: I
) -> Result<Arc<ImmutableImage>, ImageCreationError> where
I: IntoIterator<Item = QueueFamily<'a>>,
M: Into<MipmapsCount>,
use ImmutableImage::uninitialized instead
pub fn uninitialized<'a, I, M>(
device: Arc<Device>,
dimensions: ImageDimensions,
format: Format,
mipmaps: M,
usage: ImageUsage,
flags: ImageCreateFlags,
layout: ImageLayout,
queue_families: I
) -> Result<(Arc<ImmutableImage>, Arc<ImmutableImageInitialization>), ImageCreationError> where
I: IntoIterator<Item = QueueFamily<'a>>,
M: Into<MipmapsCount>,
pub fn uninitialized<'a, I, M>(
device: Arc<Device>,
dimensions: ImageDimensions,
format: Format,
mipmaps: M,
usage: ImageUsage,
flags: ImageCreateFlags,
layout: ImageLayout,
queue_families: I
) -> Result<(Arc<ImmutableImage>, Arc<ImmutableImageInitialization>), ImageCreationError> where
I: IntoIterator<Item = QueueFamily<'a>>,
M: Into<MipmapsCount>,
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.
pub fn from_iter<Px, I>(
iter: I,
dimensions: ImageDimensions,
mipmaps: MipmapsCount,
format: Format,
queue: Arc<Queue>
) -> Result<(Arc<Self>, CommandBufferExecFuture<NowFuture, PrimaryAutoCommandBuffer>), ImageCreationError> where
Px: Pixel + Send + Sync + Clone + 'static,
I: IntoIterator<Item = Px>,
I::IntoIter: ExactSizeIterator,
pub fn from_iter<Px, I>(
iter: I,
dimensions: ImageDimensions,
mipmaps: MipmapsCount,
format: Format,
queue: Arc<Queue>
) -> Result<(Arc<Self>, CommandBufferExecFuture<NowFuture, PrimaryAutoCommandBuffer>), ImageCreationError> where
Px: Pixel + Send + Sync + Clone + 'static,
I: IntoIterator<Item = Px>,
I::IntoIter: ExactSizeIterator,
Construct an ImmutableImage from the contents of iter
.
pub fn from_buffer<B, Px>(
source: Arc<B>,
dimensions: ImageDimensions,
mipmaps: MipmapsCount,
format: Format,
queue: Arc<Queue>
) -> Result<(Arc<Self>, CommandBufferExecFuture<NowFuture, PrimaryAutoCommandBuffer>), ImageCreationError> where
B: TypedBufferAccess<Content = [Px]> + 'static,
Px: Pixel + Send + Sync + Clone + 'static,
pub fn from_buffer<B, Px>(
source: Arc<B>,
dimensions: ImageDimensions,
mipmaps: MipmapsCount,
format: Format,
queue: Arc<Queue>
) -> Result<(Arc<Self>, CommandBufferExecFuture<NowFuture, PrimaryAutoCommandBuffer>), ImageCreationError> where
B: TypedBufferAccess<Content = [Px]> + 'static,
Px: Pixel + Send + Sync + Clone + 'static,
Construct an ImmutableImage containing a copy of the data in source
.
Trait Implementations
Returns the inner unsafe image object used by this image.
Returns the layout that the image has when it is first used in a primary command buffer. Read more
Returns the layout that the image must be returned to before the end of the command buffer. Read more
Returns an ImageDescriptorLayouts
structure specifying the image layout to use
in descriptors of various kinds. Read more
Returns a key that uniquely identifies the memory content of the image. Two ranges that potentially overlap in memory must return the same key. Read more
fn try_gpu_lock(
&self,
exclusive_access: bool,
uninitialized_safe: bool,
expected_layout: ImageLayout
) -> Result<(), AccessError>
fn try_gpu_lock(
&self,
exclusive_access: bool,
uninitialized_safe: bool,
expected_layout: ImageLayout
) -> Result<(), AccessError>
Locks the resource for usage on the GPU. Returns an error if the lock can’t be acquired. Read more
Locks the resource for usage on the GPU. Supposes that the resource is already locked, and simply increases the lock by one. Read more
Unlocks the resource previously acquired with try_gpu_lock
or increase_gpu_lock
. Read more
Returns the current mip level that is accessed by the gpu
Returns the current layer level that is accessed by the gpu
Returns the number of mipmap levels of this image.
Returns the number of samples of this image.
Returns the dimensions of the image.
Returns true if the image can be used as a source for blits.
Returns true if the image can be used as a destination for blits.
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 more
unsafe 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 more
Checks whether pixels of type P
match the format of the image.
Auto Trait Implementations
impl<A> RefUnwindSafe for ImmutableImage<A> where
A: RefUnwindSafe,
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> UnwindSafe for ImmutableImage<A> where
A: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Builds a pointer to this type from a raw pointer.
Returns true if the size is suitable to store a type like this.
Returns the size of an individual element.