Enum wgpu_types::MemoryHints
source · 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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)