Struct vulkano::image::StorageImage
source · [−]pub struct StorageImage<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 StorageImage
impl StorageImage
sourcepub fn new<'a, I>(
device: Arc<Device>,
dimensions: ImageDimensions,
format: Format,
queue_families: I
) -> Result<Arc<StorageImage>, ImageCreationError> where
I: IntoIterator<Item = QueueFamily<'a>>,
pub fn new<'a, I>(
device: Arc<Device>,
dimensions: ImageDimensions,
format: Format,
queue_families: I
) -> Result<Arc<StorageImage>, ImageCreationError> where
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: ImageDimensions,
format: Format,
usage: ImageUsage,
flags: ImageCreateFlags,
queue_families: I
) -> Result<Arc<StorageImage>, ImageCreationError> where
I: IntoIterator<Item = QueueFamily<'a>>,
pub fn with_usage<'a, I>(
device: Arc<Device>,
dimensions: ImageDimensions,
format: Format,
usage: ImageUsage,
flags: ImageCreateFlags,
queue_families: I
) -> Result<Arc<StorageImage>, ImageCreationError> where
I: IntoIterator<Item = QueueFamily<'a>>,
Same as new
, but allows specifying the usage.
pub fn new_with_exportable_fd<'a, I>(
device: Arc<Device>,
dimensions: ImageDimensions,
format: Format,
usage: ImageUsage,
flags: ImageCreateFlags,
queue_families: I
) -> Result<Arc<StorageImage>, ImageCreationError> where
I: IntoIterator<Item = QueueFamily<'a>>,
sourcepub fn export_posix_fd(&self) -> Result<File, DeviceMemoryExportError>
pub fn export_posix_fd(&self) -> Result<File, DeviceMemoryExportError>
Exports posix file descriptor for the allocated memory
requires khr_external_memory_fd
and khr_external_memory
extensions to be loaded.
sourcepub fn mem_size(&self) -> DeviceSize
pub fn mem_size(&self) -> DeviceSize
Return the size of the allocated memory (used for e.g. with cuda)
Trait Implementations
sourceimpl<A: Debug> Debug for StorageImage<A> where
A: MemoryPool,
A::Alloc: Debug,
impl<A: Debug> Debug for StorageImage<A> where
A: MemoryPool,
A::Alloc: Debug,
sourceimpl<A> Hash for StorageImage<A> where
A: MemoryPool,
impl<A> Hash for StorageImage<A> where
A: MemoryPool,
sourceimpl<A> ImageAccess for StorageImage<A> where
A: MemoryPool,
impl<A> ImageAccess for StorageImage<A> where
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 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 more
sourcefn 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,
uninitialized_safe: bool,
expected_layout: ImageLayout
) -> Result<(), AccessError>
fn try_gpu_lock(
&self,
_: 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
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>)
Unlocks the resource previously acquired with try_gpu_lock
or increase_gpu_lock
. Read more
sourcefn current_mip_levels_access(&self) -> Range<u32>
fn current_mip_levels_access(&self) -> Range<u32>
Returns the current mip level that is accessed by the gpu
sourcefn current_array_layers_access(&self) -> Range<u32>
fn current_array_layers_access(&self) -> Range<u32>
Returns the current array layer that is accessed by the gpu
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 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.
sourceunsafe 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 more
fn is_layout_initialized(&self) -> bool
unsafe fn 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 more
sourceimpl<A> ImageClearValue<ClearValue> for StorageImage<A> where
A: MemoryPool,
impl<A> ImageClearValue<ClearValue> for StorageImage<A> where
A: MemoryPool,
fn decode(&self, value: ClearValue) -> Option<ClearValue>
sourceimpl<P, A> ImageContent<P> for StorageImage<A> where
A: MemoryPool,
impl<P, A> ImageContent<P> for StorageImage<A> where
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<A> PartialEq<StorageImage<A>> for StorageImage<A> where
A: MemoryPool,
impl<A> PartialEq<StorageImage<A>> for StorageImage<A> where
A: MemoryPool,
impl<A> Eq for StorageImage<A> where
A: MemoryPool,
Auto Trait Implementations
impl<A> RefUnwindSafe for StorageImage<A> where
<A as MemoryPool>::Alloc: RefUnwindSafe,
impl<A> Send for StorageImage<A>
impl<A> Sync for StorageImage<A>
impl<A> Unpin for StorageImage<A> where
<A as MemoryPool>::Alloc: Unpin,
impl<A> UnwindSafe for StorageImage<A> where
<A as MemoryPool>::Alloc: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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