pub struct AdaptiveQuality { /* private fields */ }Expand description
Exponentially smoothed frame time with hysteresis over QualityTier.
Implementations§
Source§impl AdaptiveQuality
impl AdaptiveQuality
Sourcepub const fn new(config: AdaptiveQualityConfig, publication: bool) -> Self
pub const fn new(config: AdaptiveQualityConfig, publication: bool) -> Self
Builds a controller at the tier one render mode starts from.
publication is the engine’s own determinism switch: the cinematic path
and off-screen publication never adapt regardless of policy, and they
start at QualityTier::Standard — the tier it holds for every frame.
An interactive path starts at QualityTier::Reduced, the tier whose
sampling matches the realtime presets the engine shipped before the
loop existed, and the loop raises it once there is measured headroom.
Sourcepub const fn target_fps(&self) -> u16
pub const fn target_fps(&self) -> u16
The frame rate the loop steers toward.
Sourcepub const fn tier(&self) -> QualityTier
pub const fn tier(&self) -> QualityTier
The tier every frame of this instant presents at.
Sourcepub const fn smoothed_ns(&self) -> u64
pub const fn smoothed_ns(&self) -> u64
The smoothed frame time in nanoseconds; zero before the first frame.
Sourcepub fn set_atom_count(&mut self, atom_count: u64)
pub fn set_atom_count(&mut self, atom_count: u64)
Applies the size-based realtime ceiling for the next frame.
This is a cheap scene-level operation. Changing to a smaller band immediately drops the tier and clears its timing window; growing a scene’s budget never causes a sudden expensive jump.
Sourcepub fn set_publication(&mut self, publication: bool)
pub fn set_publication(&mut self, publication: bool)
Marks the engine as running the deterministic publication path.
Entering publication holds the tier constant from that frame on.
Sourcepub fn observe(&mut self, frame_ns: u64) -> QualityTier
pub fn observe(&mut self, frame_ns: u64) -> QualityTier
Feeds one frame’s wall-clock duration and returns the tier the next frame presents at.
The caller chooses the sample source per target: the native render
call duration (CPU encoding/submission) or the browser
submission-to-fence-completion elapsed time. Both are host-clock
durations, neither is GPU execution time, and each frame feeds exactly
one sample from exactly one source.
Trait Implementations§
Source§impl Clone for AdaptiveQuality
impl Clone for AdaptiveQuality
impl Copy for AdaptiveQuality
Source§impl Debug for AdaptiveQuality
impl Debug for AdaptiveQuality
Auto Trait Implementations§
impl Freeze for AdaptiveQuality
impl RefUnwindSafe for AdaptiveQuality
impl Send for AdaptiveQuality
impl Sync for AdaptiveQuality
impl Unpin for AdaptiveQuality
impl UnsafeUnpin for AdaptiveQuality
impl UnwindSafe for AdaptiveQuality
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§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