pub struct FrameCacheBudget { /* private fields */ }Expand description
Idle retention limits for composition scratch and cached draw bindings.
Active work remains bounded by FrameBudget. When a frame exceeds these
cache limits it still renders, but excess storage is released afterwards.
Zero limits disable retention. Driver allocations and in-flight retirement
are outside these library-owned byte counts.
Implementations§
Source§impl FrameCacheBudget
impl FrameCacheBudget
Sourcepub const fn new(
cpu_bytes: usize,
uniform_bytes: usize,
texture_bytes: usize,
bindings: usize,
) -> Self
pub const fn new( cpu_bytes: usize, uniform_bytes: usize, texture_bytes: usize, bindings: usize, ) -> Self
Creates exact retention limits with packed uploads disabled. Zero is a
valid disabled cache; use with_upload_staging_bytes to opt into packing.
Sourcepub const fn max_cpu_bytes(self) -> usize
pub const fn max_cpu_bytes(self) -> usize
Maximum idle CPU scratch, slot metadata and saved uniform bytes.
Sourcepub const fn max_uniform_bytes(self) -> usize
pub const fn max_uniform_bytes(self) -> usize
Maximum retained GPU uniform buffer bytes.
Sourcepub const fn max_texture_bytes(self) -> usize
pub const fn max_texture_bytes(self) -> usize
Maximum distinct texture bytes kept alive by cached bindings.
Sourcepub const fn max_bindings(self) -> usize
pub const fn max_bindings(self) -> usize
Maximum cached per-item binding slots.
Sourcepub const fn with_upload_staging_bytes(self, bytes: usize) -> Self
pub const fn with_upload_staging_bytes(self, bytes: usize) -> Self
Enables bounded packing of changed retained uniforms into one upload.
The cap limits the retained GPU transfer buffer and CPU payload separately;
payload and copy-record capacities also count toward max_cpu_bytes.
Zero disables batching. Small/oversized batches keep direct writes, so
this optional optimization does not change accepted frame budgets.
new disables batching; default permits 256 KiB.
Sourcepub const fn max_upload_staging_bytes(self) -> usize
pub const fn max_upload_staging_bytes(self) -> usize
Maximum GPU transfer-buffer bytes for packed uniform uploads, separate from the uniform-buffer limit. In-flight driver retirement is excluded.
Trait Implementations§
Source§impl Clone for FrameCacheBudget
impl Clone for FrameCacheBudget
impl Copy for FrameCacheBudget
Source§impl Debug for FrameCacheBudget
impl Debug for FrameCacheBudget
Source§impl Default for FrameCacheBudget
impl Default for FrameCacheBudget
impl Eq for FrameCacheBudget
Source§impl PartialEq for FrameCacheBudget
impl PartialEq for FrameCacheBudget
impl StructuralPartialEq for FrameCacheBudget
Auto Trait Implementations§
impl Freeze for FrameCacheBudget
impl RefUnwindSafe for FrameCacheBudget
impl Send for FrameCacheBudget
impl Sync for FrameCacheBudget
impl Unpin for FrameCacheBudget
impl UnsafeUnpin for FrameCacheBudget
impl UnwindSafe for FrameCacheBudget
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.