Enum MemoryHints
pub enum MemoryHints {
Performance,
MemoryUsage,
Manual {
suballocated_device_memory_block_size: Range<u64>,
},
}Expand description
Hints to the device about the memory allocation strategy.
Some backends may ignore these hints.
Variants§
Performance
Favor performance over memory usage (the default value).
MemoryUsage
Favor memory usage over performance.
Manual
Applications that have control over the content that is rendered (typically games) may find an optimal compromise between memory usage and performance by specifying the allocation configuration.
Fields
suballocated_device_memory_block_size: Range<u64>Defines the range of allowed memory block sizes for sub-allocated resources.
The backend may attempt to group multiple resources into fewer device memory blocks (sub-allocation) for performance reasons. The start of the provided range specifies the initial memory block size for sub-allocated resources. After running out of space in existing memory blocks, the backend may chose to progressively increase the block size of subsequent allocations up to a limit specified by the end of the range.
This does not limit resource sizes. If a resource does not fit in the specified range, it will typically be placed in a dedicated memory block.
Implementations§
§impl MemoryHints
impl MemoryHints
pub const fn default() -> MemoryHints
pub const fn default() -> MemoryHints
This function is identical to Default::default() except that it is a const fn.
Trait Implementations§
§impl Clone for MemoryHints
impl Clone for MemoryHints
§fn clone(&self) -> MemoryHints
fn clone(&self) -> MemoryHints
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for MemoryHints
impl Debug for MemoryHints
§impl Default for MemoryHints
impl Default for MemoryHints
§fn default() -> MemoryHints
fn default() -> MemoryHints
§impl<'de> Deserialize<'de> for MemoryHints
impl<'de> Deserialize<'de> for MemoryHints
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MemoryHints, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MemoryHints, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for MemoryHints
impl PartialEq for MemoryHints
§impl Serialize for MemoryHints
impl Serialize for MemoryHints
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for MemoryHints
impl StructuralPartialEq for MemoryHints
Auto Trait Implementations§
impl Freeze for MemoryHints
impl RefUnwindSafe for MemoryHints
impl Send for MemoryHints
impl Sync for MemoryHints
impl Unpin for MemoryHints
impl UnwindSafe for MemoryHints
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more