Struct vulkano::image::StorageImage
source · pub struct StorageImage<F, A = Arc<StdMemoryPool>>where
A: MemoryPool,{ /* private fields */ }
Expand description
General-purpose image in device memory. Can be used for any usage, but will be slower than a specialized image.
Implementations
sourceimpl<F> StorageImage<F>
impl<F> StorageImage<F>
sourcepub fn new<'a, I>(
device: Arc<Device>,
dimensions: Dimensions,
format: F,
queue_families: I
) -> Result<Arc<StorageImage<F>>, ImageCreationError>where
F: FormatDesc,
I: IntoIterator<Item = QueueFamily<'a>>,
pub fn new<'a, I>(
device: Arc<Device>,
dimensions: Dimensions,
format: F,
queue_families: I
) -> Result<Arc<StorageImage<F>>, ImageCreationError>where
F: FormatDesc,
I: IntoIterator<Item = QueueFamily<'a>>,
Creates a new image with the given dimensions and format.
sourcepub fn with_usage<'a, I>(
device: Arc<Device>,
dimensions: Dimensions,
format: F,
usage: ImageUsage,
queue_families: I
) -> Result<Arc<StorageImage<F>>, ImageCreationError>where
F: FormatDesc,
I: IntoIterator<Item = QueueFamily<'a>>,
pub fn with_usage<'a, I>(
device: Arc<Device>,
dimensions: Dimensions,
format: F,
usage: ImageUsage,
queue_families: I
) -> Result<Arc<StorageImage<F>>, ImageCreationError>where
F: FormatDesc,
I: IntoIterator<Item = QueueFamily<'a>>,
Same as new
, but allows specifying the usage.
sourceimpl<F, A> StorageImage<F, A>where
A: MemoryPool,
impl<F, A> StorageImage<F, A>where
A: MemoryPool,
sourcepub fn dimensions(&self) -> Dimensions
pub fn dimensions(&self) -> Dimensions
Returns the dimensions of the image.
Trait Implementations
sourceimpl<F: Debug, A: Debug> Debug for StorageImage<F, A>where
A: MemoryPool,
A::Alloc: Debug,
impl<F: Debug, A: Debug> Debug for StorageImage<F, A>where
A: MemoryPool,
A::Alloc: Debug,
sourceimpl<F, A> ImageAccess for StorageImage<F, A>where
F: 'static + Send + Sync,
A: MemoryPool,
impl<F, A> ImageAccess for StorageImage<F, A>where
F: 'static + Send + Sync,
A: MemoryPool,
sourcefn inner(&self) -> ImageInner<'_>
fn inner(&self) -> ImageInner<'_>
Returns the inner unsafe image object used by this image.
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 conflicts_buffer(&self, other: &dyn BufferAccess) -> bool
fn conflicts_buffer(&self, other: &dyn BufferAccess) -> bool
Returns true if an access to
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
Returns true if an access to
self
potentially overlaps the same memory as an
access to other
. Read moresourcefn conflict_key(&self) -> u64
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
sourcefn try_gpu_lock(
&self,
_: bool,
expected_layout: ImageLayout
) -> Result<(), AccessError>
fn try_gpu_lock(
&self,
_: 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
sourceunsafe fn increase_gpu_lock(&self)
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
sourceunsafe fn unlock(&self, new_layout: Option<ImageLayout>)
unsafe fn unlock(&self, new_layout: Option<ImageLayout>)
sourcefn has_depth(&self) -> bool
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
sourcefn has_stencil(&self) -> bool
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
sourcefn mipmap_levels(&self) -> u32
fn mipmap_levels(&self) -> u32
Returns the number of mipmap levels of this image.
sourcefn dimensions(&self) -> ImageDimensions
fn dimensions(&self) -> ImageDimensions
Returns the dimensions of the image.
sourcefn supports_blit_source(&self) -> bool
fn supports_blit_source(&self) -> bool
Returns true if the image can be used as a source for blits.
sourcefn supports_blit_destination(&self) -> bool
fn supports_blit_destination(&self) -> bool
Returns true if the image can be used as a destination for blits.
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,
Wraps around this
ImageAccess
and returns an identical ImageAccess
but whose initial
layout requirement is either Undefined
or Preinitialized
. Read moresourceimpl<F, A> ImageClearValue<<F as FormatDesc>::ClearValue> for StorageImage<F, A>where
F: FormatDesc + 'static + Send + Sync,
A: MemoryPool,
impl<F, A> ImageClearValue<<F as FormatDesc>::ClearValue> for StorageImage<F, A>where
F: FormatDesc + 'static + Send + Sync,
A: MemoryPool,
fn decode(&self, value: F::ClearValue) -> Option<ClearValue>
sourceimpl<P, F, A> ImageContent<P> for StorageImage<F, A>where
F: 'static + Send + Sync,
A: MemoryPool,
impl<P, F, A> ImageContent<P> for StorageImage<F, A>where
F: 'static + Send + Sync,
A: MemoryPool,
sourcefn matches_format(&self) -> bool
fn matches_format(&self) -> bool
Checks whether pixels of type
P
match the format of the image.sourceimpl<F, A> ImageViewAccess for StorageImage<F, A>where
F: 'static + Send + Sync,
A: MemoryPool,
impl<F, A> ImageViewAccess for StorageImage<F, A>where
F: 'static + Send + Sync,
A: MemoryPool,
fn parent(&self) -> &dyn ImageAccess
sourcefn dimensions(&self) -> Dimensions
fn dimensions(&self) -> Dimensions
Returns the dimensions of the image view.
sourcefn inner(&self) -> &UnsafeImageView
fn inner(&self) -> &UnsafeImageView
Returns the inner unsafe image view object used by this image view.
sourcefn descriptor_set_storage_image_layout(&self) -> ImageLayout
fn descriptor_set_storage_image_layout(&self) -> ImageLayout
Returns the image layout to use in a descriptor with the given subresource.
sourcefn descriptor_set_combined_image_sampler_layout(&self) -> ImageLayout
fn descriptor_set_combined_image_sampler_layout(&self) -> ImageLayout
Returns the image layout to use in a descriptor with the given subresource.
sourcefn descriptor_set_sampled_image_layout(&self) -> ImageLayout
fn descriptor_set_sampled_image_layout(&self) -> ImageLayout
Returns the image layout to use in a descriptor with the given subresource.
sourcefn descriptor_set_input_attachment_layout(&self) -> ImageLayout
fn descriptor_set_input_attachment_layout(&self) -> ImageLayout
Returns the image layout to use in a descriptor with the given subresource.
sourcefn identity_swizzle(&self) -> bool
fn identity_swizzle(&self) -> bool
Returns true if the view doesn’t use components swizzling. Read more
sourcefn format(&self) -> Format
fn format(&self) -> Format
Returns the format of this view. This can be different from the parent’s format.
fn samples(&self) -> u32
sourcefn can_be_sampled(&self, _sampler: &Sampler) -> bool
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> RefUnwindSafe for StorageImage<F, A>where
F: RefUnwindSafe,
<A as MemoryPool>::Alloc: RefUnwindSafe,
impl<F, A> Send for StorageImage<F, A>where
F: Send,
<A as MemoryPool>::Alloc: Send,
impl<F, A> Sync for StorageImage<F, A>where
F: Sync,
<A as MemoryPool>::Alloc: Sync,
impl<F, A> Unpin for StorageImage<F, A>where
F: Unpin,
<A as MemoryPool>::Alloc: Unpin,
impl<F, A> UnwindSafe for StorageImage<F, A>where
F: UnwindSafe,
<A as MemoryPool>::Alloc: UnwindSafe,
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
sourceimpl<T> Content for T
impl<T> Content for T
sourcefn ref_from_ptr<'a>(ptr: *mut c_void, size: usize) -> Option<*mut T>
fn ref_from_ptr<'a>(ptr: *mut c_void, size: usize) -> Option<*mut T>
Builds a pointer to this type from a raw pointer.
sourcefn is_size_suitable(size: usize) -> bool
fn is_size_suitable(size: usize) -> bool
Returns true if the size is suitable to store a type like this.
sourcefn indiv_size() -> usize
fn indiv_size() -> usize
Returns the size of an individual element.