pub struct AllocatorMemoryRequirements {
pub own_memory: bool,
pub usage: MemoryUsage,
pub required_flags: MemoryPropertyFlags,
pub preferred_flags: Option<MemoryPropertyFlags>,
pub never_allocate: bool,
}
Expand description
In addition to normal MemoryRequirements
, this struct provides additional details affecting
how the allocator chooses memory to allocate.
Fields§
§own_memory: bool
Set to true if this allocation should have its own memory block.
Use it for special, big resources, like fullscreen images used as attachments.
This flag must also be used for host visible resources that you want to map
simultaneously because otherwise they might end up as regions of the same
DeviceMemory
, and mapping the same DeviceMemory
multiple times is illegal.
usage: MemoryUsage
Intended usage of the allocated memory. If you specify required_flags
as non-empty,
you can (but do not have to) leave this set to MemoryUsage::Unknown
.
required_flags: MemoryPropertyFlags
Flags that must be satisfied by the memory type used for allocation. Can be left empty if
usage
is not MemoryUsage::Unknown
.
preferred_flags: Option<MemoryPropertyFlags>
Flags that determine which memory types should be chosen preferentially over others. If
this is not empty, it must be a superset of required_flags
.
never_allocate: bool
Set this flag to only try to allocate from existing device memory blocks and never create new blocks.
If the new allocation cannot be placed in any of the existing blocks, allocation
fails with Error::OutOfDeviceMemory
.
It makes no sense to set own_memory
and never_allocate
at the same time.
Trait Implementations§
Source§impl Clone for AllocatorMemoryRequirements
impl Clone for AllocatorMemoryRequirements
Source§fn clone(&self) -> AllocatorMemoryRequirements
fn clone(&self) -> AllocatorMemoryRequirements
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more