Struct vulkano::image::immutable::ImmutableImage [−][src]
pub struct ImmutableImage<F, A = PotentialDedicatedAllocation<StdMemoryPoolAlloc>> { /* fields omitted */ }
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.
Methods
impl<F> ImmutableImage<F>
[src]
impl<F> ImmutableImage<F>
pub fn new<'a, I>(
device: Arc<Device>,
dimensions: Dimensions,
format: F,
queue_families: I
) -> Result<Arc<ImmutableImage<F>>, ImageCreationError> where
F: FormatDesc,
I: IntoIterator<Item = QueueFamily<'a>>,
[src]
pub fn new<'a, I>(
device: Arc<Device>,
dimensions: Dimensions,
format: F,
queue_families: I
) -> Result<Arc<ImmutableImage<F>>, ImageCreationError> where
F: FormatDesc,
I: IntoIterator<Item = QueueFamily<'a>>,
: use ImmutableImage::uninitialized instead
pub fn with_mipmaps<'a, I, M>(
device: Arc<Device>,
dimensions: Dimensions,
format: F,
mipmaps: M,
queue_families: I
) -> Result<Arc<ImmutableImage<F>>, ImageCreationError> where
F: FormatDesc,
I: IntoIterator<Item = QueueFamily<'a>>,
M: Into<MipmapsCount>,
[src]
pub fn with_mipmaps<'a, I, M>(
device: Arc<Device>,
dimensions: Dimensions,
format: F,
mipmaps: M,
queue_families: I
) -> Result<Arc<ImmutableImage<F>>, ImageCreationError> where
F: FormatDesc,
I: IntoIterator<Item = QueueFamily<'a>>,
M: Into<MipmapsCount>,
: use ImmutableImage::uninitialized instead
pub fn uninitialized<'a, I, M>(
device: Arc<Device>,
dimensions: Dimensions,
format: F,
mipmaps: M,
usage: ImageUsage,
layout: ImageLayout,
queue_families: I
) -> Result<(Arc<ImmutableImage<F>>, ImmutableImageInitialization<F>), ImageCreationError> where
F: FormatDesc,
I: IntoIterator<Item = QueueFamily<'a>>,
M: Into<MipmapsCount>,
[src]
pub fn uninitialized<'a, I, M>(
device: Arc<Device>,
dimensions: Dimensions,
format: F,
mipmaps: M,
usage: ImageUsage,
layout: ImageLayout,
queue_families: I
) -> Result<(Arc<ImmutableImage<F>>, ImmutableImageInitialization<F>), ImageCreationError> where
F: FormatDesc,
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<P, I>(
iter: I,
dimensions: Dimensions,
format: F,
queue: Arc<Queue>
) -> Result<(Arc<Self>, CommandBufferExecFuture<NowFuture, AutoCommandBuffer>), ImageCreationError> where
P: Send + Sync + Clone + 'static,
F: FormatDesc + AcceptsPixels<P> + 'static + Send + Sync,
I: ExactSizeIterator<Item = P>,
Format: AcceptsPixels<P>,
[src]
pub fn from_iter<P, I>(
iter: I,
dimensions: Dimensions,
format: F,
queue: Arc<Queue>
) -> Result<(Arc<Self>, CommandBufferExecFuture<NowFuture, AutoCommandBuffer>), ImageCreationError> where
P: Send + Sync + Clone + 'static,
F: FormatDesc + AcceptsPixels<P> + 'static + Send + Sync,
I: ExactSizeIterator<Item = P>,
Format: AcceptsPixels<P>,
Construct an ImmutableImage from the contents of iter
.
TODO: Support mipmaps
pub fn from_buffer<B, P>(
source: B,
dimensions: Dimensions,
format: F,
queue: Arc<Queue>
) -> Result<(Arc<Self>, CommandBufferExecFuture<NowFuture, AutoCommandBuffer>), ImageCreationError> where
B: BufferAccess + TypedBufferAccess<Content = [P]> + 'static + Clone + Send + Sync,
P: Send + Sync + Clone + 'static,
F: FormatDesc + AcceptsPixels<P> + 'static + Send + Sync,
Format: AcceptsPixels<P>,
[src]
pub fn from_buffer<B, P>(
source: B,
dimensions: Dimensions,
format: F,
queue: Arc<Queue>
) -> Result<(Arc<Self>, CommandBufferExecFuture<NowFuture, AutoCommandBuffer>), ImageCreationError> where
B: BufferAccess + TypedBufferAccess<Content = [P]> + 'static + Clone + Send + Sync,
P: Send + Sync + Clone + 'static,
F: FormatDesc + AcceptsPixels<P> + 'static + Send + Sync,
Format: AcceptsPixels<P>,
Construct an ImmutableImage containing a copy of the data in source
.
TODO: Support mipmaps
impl<F, A> ImmutableImage<F, A>
[src]
impl<F, A> ImmutableImage<F, A>
pub fn dimensions(&self) -> Dimensions
[src]
pub fn dimensions(&self) -> Dimensions
Returns the dimensions of the image.
pub fn mipmap_levels(&self) -> u32
[src]
pub fn mipmap_levels(&self) -> u32
Returns the number of mipmap levels of the image.
Trait Implementations
impl<F: Debug, A: Debug> Debug for ImmutableImage<F, A>
[src]
impl<F: Debug, A: Debug> Debug for ImmutableImage<F, A>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<F, A> ImageAccess for ImmutableImage<F, A> where
F: 'static + Send + Sync,
[src]
impl<F, A> ImageAccess for ImmutableImage<F, A> where
F: 'static + Send + Sync,
fn inner(&self) -> ImageInner
[src]
fn inner(&self) -> ImageInner
Returns the inner unsafe image object used by this image.
fn initial_layout_requirement(&self) -> ImageLayout
[src]
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
fn final_layout_requirement(&self) -> ImageLayout
[src]
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
fn conflicts_buffer(&self, other: &BufferAccess) -> bool
[src]
fn conflicts_buffer(&self, other: &BufferAccess) -> bool
Returns true if an access to self
potentially overlaps the same memory as an access to other
. Read more
fn conflicts_image(&self, other: &ImageAccess) -> bool
[src]
fn conflicts_image(&self, other: &ImageAccess) -> bool
Returns true if an access to self
potentially overlaps the same memory as an access to other
. Read more
fn conflict_key(&self) -> u64
[src]
fn conflict_key(&self) -> u64
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,
expected_layout: ImageLayout
) -> Result<(), AccessError>
[src]
fn try_gpu_lock(
&self,
exclusive_access: 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
unsafe fn increase_gpu_lock(&self)
[src]
unsafe fn increase_gpu_lock(&self)
Locks the resource for usage on the GPU. Supposes that the resource is already locked, and simply increases the lock by one. Read more
unsafe fn unlock(&self, new_layout: Option<ImageLayout>)
[src]
unsafe fn unlock(&self, new_layout: Option<ImageLayout>)
Unlocks the resource previously acquired with try_gpu_lock
or increase_gpu_lock
. Read more
fn format(&self) -> Format
[src]
fn format(&self) -> Format
Returns the format of this image.
fn has_color(&self) -> bool
[src]
fn has_color(&self) -> bool
Returns true if the image is a color image.
fn has_depth(&self) -> bool
[src]
fn has_depth(&self) -> bool
Returns true if the image has a depth component. In other words, if it is a depth or a depth-stencil format. Read more
fn has_stencil(&self) -> bool
[src]
fn has_stencil(&self) -> bool
Returns true if the image has a stencil component. In other words, if it is a stencil or a depth-stencil format. Read more
fn mipmap_levels(&self) -> u32
[src]
fn mipmap_levels(&self) -> u32
Returns the number of mipmap levels of this image.
fn samples(&self) -> u32
[src]
fn samples(&self) -> u32
Returns the number of samples of this image.
fn dimensions(&self) -> ImageDimensions
[src]
fn dimensions(&self) -> ImageDimensions
Returns the dimensions of the image.
fn supports_blit_source(&self) -> bool
[src]
fn supports_blit_source(&self) -> bool
Returns true if the image can be used as a source for blits.
fn supports_blit_destination(&self) -> bool
[src]
fn supports_blit_destination(&self) -> bool
Returns true if the image can be used as a destination for blits.
unsafe fn forced_undefined_initial_layout(
self,
preinitialized: bool
) -> ImageAccessFromUndefinedLayout<Self> where
Self: Sized,
[src]
unsafe fn forced_undefined_initial_layout(
self,
preinitialized: bool
) -> 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
impl<P, F, A> ImageContent<P> for ImmutableImage<F, A> where
F: 'static + Send + Sync,
[src]
impl<P, F, A> ImageContent<P> for ImmutableImage<F, A> where
F: 'static + Send + Sync,
fn matches_format(&self) -> bool
[src]
fn matches_format(&self) -> bool
Checks whether pixels of type P
match the format of the image.
impl<F: 'static, A> ImageViewAccess for ImmutableImage<F, A> where
F: 'static + Send + Sync,
[src]
impl<F: 'static, A> ImageViewAccess for ImmutableImage<F, A> where
F: 'static + Send + Sync,
fn parent(&self) -> &ImageAccess
[src]
fn parent(&self) -> &ImageAccess
fn dimensions(&self) -> Dimensions
[src]
fn dimensions(&self) -> Dimensions
Returns the dimensions of the image view.
fn inner(&self) -> &UnsafeImageView
[src]
fn inner(&self) -> &UnsafeImageView
Returns the inner unsafe image view object used by this image view.
fn descriptor_set_storage_image_layout(&self) -> ImageLayout
[src]
fn descriptor_set_storage_image_layout(&self) -> ImageLayout
Returns the image layout to use in a descriptor with the given subresource.
fn descriptor_set_combined_image_sampler_layout(&self) -> ImageLayout
[src]
fn descriptor_set_combined_image_sampler_layout(&self) -> ImageLayout
Returns the image layout to use in a descriptor with the given subresource.
fn descriptor_set_sampled_image_layout(&self) -> ImageLayout
[src]
fn descriptor_set_sampled_image_layout(&self) -> ImageLayout
Returns the image layout to use in a descriptor with the given subresource.
fn descriptor_set_input_attachment_layout(&self) -> ImageLayout
[src]
fn descriptor_set_input_attachment_layout(&self) -> ImageLayout
Returns the image layout to use in a descriptor with the given subresource.
fn identity_swizzle(&self) -> bool
[src]
fn identity_swizzle(&self) -> bool
Returns true if the view doesn't use components swizzling. Read more
fn format(&self) -> Format
[src]
fn format(&self) -> Format
Returns the format of this view. This can be different from the parent's format.
fn samples(&self) -> u32
[src]
fn samples(&self) -> u32
fn can_be_sampled(&self, _sampler: &Sampler) -> bool
[src]
fn can_be_sampled(&self, _sampler: &Sampler) -> bool
Returns true if the given sampler can be used with this image view. Read more
Auto Trait Implementations
impl<F, A> Send for ImmutableImage<F, A> where
A: Send,
F: Send,
impl<F, A> Send for ImmutableImage<F, A> where
A: Send,
F: Send,
impl<F, A> Sync for ImmutableImage<F, A> where
A: Sync,
F: Sync,
impl<F, A> Sync for ImmutableImage<F, A> where
A: Sync,
F: Sync,