metal: commit 1.5ms before the next page flip
This commit is contained in:
parent
a37ce1acda
commit
87d60d267e
4 changed files with 105 additions and 9 deletions
|
|
@ -7,7 +7,6 @@ pub struct GeometricDecay {
|
|||
}
|
||||
|
||||
impl GeometricDecay {
|
||||
#[expect(dead_code)]
|
||||
pub fn new(mut p1: f64, reset: u64) -> Self {
|
||||
if p1.is_nan() || p1 < 0.01 {
|
||||
p1 = 0.01;
|
||||
|
|
@ -23,17 +22,14 @@ impl GeometricDecay {
|
|||
}
|
||||
}
|
||||
|
||||
#[expect(dead_code)]
|
||||
pub fn reset(&self, v: u64) {
|
||||
self.v.set(v as f64 / self.p1);
|
||||
}
|
||||
|
||||
#[expect(dead_code)]
|
||||
pub fn get(&self) -> u64 {
|
||||
(self.p1 * self.v.get()) as u64
|
||||
}
|
||||
|
||||
#[expect(dead_code)]
|
||||
pub fn add(&self, n: u64) {
|
||||
let v = n as f64 + self.p2 * self.v.get();
|
||||
self.v.set(v);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue