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.
Trait Implementations§
Source§impl Clone for MemoryHints
impl Clone for MemoryHints
Source§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 moreSource§impl Debug for MemoryHints
impl Debug for MemoryHints
Source§impl Default for MemoryHints
impl Default for MemoryHints
Source§fn default() -> MemoryHints
fn default() -> MemoryHints
Source§impl<'de> Deserialize<'de> for MemoryHints
impl<'de> Deserialize<'de> for MemoryHints
Source§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>,
Source§impl Serialize for MemoryHints
impl Serialize for MemoryHints
Source§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,
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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)