Struct vulkan_malloc::AllocatorMemoryRequirements
[−]
[src]
pub struct AllocatorMemoryRequirements { pub own_memory: bool, pub usage: MemoryUsage, pub required_flags: MemoryPropertyFlags, pub preferred_flags: Option<MemoryPropertyFlags>, pub never_allocate: bool, }
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
impl Copy for AllocatorMemoryRequirements
[src]
impl Clone for AllocatorMemoryRequirements
[src]
fn clone(&self) -> AllocatorMemoryRequirements
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for AllocatorMemoryRequirements
[src]
fn eq(&self, __arg_0: &AllocatorMemoryRequirements) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &AllocatorMemoryRequirements) -> bool
[src]
This method tests for !=
.
impl Eq for AllocatorMemoryRequirements
[src]
impl PartialOrd for AllocatorMemoryRequirements
[src]
fn partial_cmp(&self, __arg_0: &AllocatorMemoryRequirements) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &AllocatorMemoryRequirements) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &AllocatorMemoryRequirements) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &AllocatorMemoryRequirements) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &AllocatorMemoryRequirements) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for AllocatorMemoryRequirements
[src]
fn cmp(&self, __arg_0: &AllocatorMemoryRequirements) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
[src]
ord_max_min
)Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
[src]
ord_max_min
)Compares and returns the minimum of two values. Read more