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
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.
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.
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 more