Enum vk_mem_erupt::MemoryUsage [−][src]
pub enum MemoryUsage { Unknown, GpuOnly, CpuOnly, CpuToGpu, GpuToCpu, CpuCopy, GpuLazilyAllocated, }
Expand description
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 erupt::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 erupt::vk::MemoryPropertyFlags::HOST_VISIBLE
and erupt::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 erupt::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 erupt::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.
CPU memory - memory that is preferably not DEVICE_LOCAL
, but also not guaranteed to be HOST_VISIBLE
.
Usage: Staging copy of resources moved from GPU memory to CPU memory as part of custom paging/residency mechanism, to be moved back to GPU memory when needed.
Lazily allocated GPU memory having VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT
.
Exists mostly on mobile platforms. Using it on desktop PC or other GPUs with no such memory type present will fail the allocation.
Usage: Memory for transient attachment images (color attachments, depth attachments etc.), created with VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
.
Allocations with this usage are always created as dedicated - it implies #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
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
Mutably borrows from an owned value. Read more