pub struct GpuRate { /* private fields */ }Expand description
One device’s rate, shared by every context clone and renderer on it.
Implementations§
Source§impl GpuRate
impl GpuRate
Sourcepub fn ms_per_unit_pixel(&self) -> Option<f64>
pub fn ms_per_unit_pixel(&self) -> Option<f64>
The rate in milliseconds per unit pixel, once seeded.
Sourcepub fn begin_calibration(&self) -> bool
pub fn begin_calibration(&self) -> bool
Returns true once per calibration due, telling that caller to run the calibration draw: before the first seed, and after frames disagreed with the floor.
Sourcepub fn seed(&self, measured_ms_per_unit_pixel: f64)
pub fn seed(&self, measured_ms_per_unit_pixel: f64)
Seeds the rate at MARGIN times measured_ms_per_unit_pixel, which becomes the floor. A
calibration drawn again that confirms the previous one keeps the rate learned since, within
the new floor and seed; one that does not forgets every pass rate.
Sourcepub fn abandon_calibration(&self)
pub fn abandon_calibration(&self)
Allows a later caller to calibrate again after a failed draw.
Sourcepub fn observe(&self, frame: FrameMeasurement)
pub fn observe(&self, frame: FrameMeasurement)
Folds in a measured frame, its work planned at passes’ own rates counted at their
prediction, so only the rest moves the device rate. Any trust lowers the rate by at most a
tenth per frame, never below the floor; an exact span over the prediction raises it to
MARGIN times the measurement.
Sourcepub fn pass_rate(&self, pass: PassKey) -> Option<f64>
pub fn pass_rate(&self, pass: PassKey) -> Option<f64>
What draws of pass measured, in milliseconds per unit pixel.
Sourcepub fn record_pass_rate(&self, pass: PassKey, measured_ms_per_unit_pixel: f64)
pub fn record_pass_rate(&self, pass: PassKey, measured_ms_per_unit_pixel: f64)
Keeps what a draw of pass measured, replacing an earlier measurement.
Sourcepub fn planning_rate(&self, device_rate: f64, pass: Option<PassKey>) -> f64
pub fn planning_rate(&self, device_rate: f64, pass: Option<PassKey>) -> f64
The rate to predict pass at: the device rate, or the pass’s own measurement scaled by
Self::margin, and at least MARGIN, when that is slower.