Shaders: the frame uniforms keep their buffer between frames
update rebuilt the values vector every frame for a fixed-length list: one allocation and one free per frame for nothing. eval_custom already treats the same vector as a buffer to truncate and extend. Co-Authored-By: Hermes Agent (Nous Research) <noreply@nousresearch.com>
This commit is contained in:
@@ -399,7 +399,8 @@ impl FrameUniforms {
|
||||
_ => Value::i(&[0]),
|
||||
}
|
||||
};
|
||||
self.values = NAMES.iter().map(|n| value(n)).collect();
|
||||
self.values.clear();
|
||||
self.values.extend(NAMES.iter().map(|n| value(n)));
|
||||
self.frame = (self.frame + 1) % 720_720;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user