[−][src]Enum vk_mem::MemoryUsage
Intended usage of memory.
Variants
No intended memory usage specified.
Use other members of AllocationCreateInfo
to specify your requirements.
Memory will be used on device only, so fast access from the device is preferred.
It usually means device-local GPU (video) memory.
No need to be mappable on host.
It is roughly equivalent of D3D12_HEAP_TYPE_DEFAULT
.
Usage:
- Resources written and read by device, e.g. images used as attachments.
- Resources transferred from host once (immutable) or infrequently and read by device multiple times, e.g. textures to be sampled, vertex buffers, uniform (constant) buffers, and majority of other types of resources used on GPU.
Allocation may still end up in ash::vk::MemoryPropertyFlags::HOST_VISIBLE
memory on some implementations.
In such case, you are free to map it.
You can use AllocationCreateFlags::MAPPED
with this usage type.
Memory will be mappable on host.
It usually means CPU (system) memory.
Guarantees to be ash::vk::MemoryPropertyFlags::HOST_VISIBLE
and ash::vk::MemoryPropertyFlags::HOST_COHERENT
.
CPU access is typically uncached. Writes may be write-combined.
Resources created in this pool may still be accessible to the device, but access to them can be slow.
It is roughly equivalent of D3D12_HEAP_TYPE_UPLOAD
.
Usage: Staging copy of resources used as transfer source.
Memory that is both mappable on host (guarantees to be ash::vk::MemoryPropertyFlags::HOST_VISIBLE
) and preferably fast to access by GPU.
CPU access is typically uncached. Writes may be write-combined.
Usage: Resources written frequently by host (dynamic), read by device. E.g. textures, vertex buffers, uniform buffers updated every frame or every draw call.
Memory mappable on host (guarantees to be ash::vk::MemoryPropertFlags::HOST_VISIBLE
) and cached.
It is roughly equivalent of D3D12_HEAP_TYPE_READBACK
.
Usage:
- Resources written by device, read by host - results of some computations, e.g. screen capture, average scene luminance for HDR tone mapping.
- Any resources read or accessed randomly on host, e.g. CPU-side copy of vertex buffer used as source of transfer, but also used for collision detection.
Trait Implementations
impl Clone for MemoryUsage
[src]
fn clone(&self) -> MemoryUsage
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for MemoryUsage
[src]
impl Debug for MemoryUsage
[src]
impl Eq for MemoryUsage
[src]
impl Hash for MemoryUsage
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for MemoryUsage
[src]
fn cmp(&self, other: &MemoryUsage) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<MemoryUsage> for MemoryUsage
[src]
fn eq(&self, other: &MemoryUsage) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<MemoryUsage> for MemoryUsage
[src]
fn partial_cmp(&self, other: &MemoryUsage) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for MemoryUsage
[src]
impl StructuralPartialEq for MemoryUsage
[src]
Auto Trait Implementations
impl RefUnwindSafe for MemoryUsage
impl Send for MemoryUsage
impl Sync for MemoryUsage
impl Unpin for MemoryUsage
impl UnwindSafe for MemoryUsage
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,