From b59d9ada27ef08208ce4ca182f5da0d9ff112ff4 Mon Sep 17 00:00:00 2001 From: Alexander Krylov Date: Mon, 26 Oct 2026 09:49:41 +0300 Subject: [PATCH] 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) --- crates/horizon-client/src/gfx/pack_uniforms.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/gfx/pack_uniforms.rs b/crates/horizon-client/src/gfx/pack_uniforms.rs index c4df4377b..8f5f1a2de 100644 --- a/crates/horizon-client/src/gfx/pack_uniforms.rs +++ b/crates/horizon-client/src/gfx/pack_uniforms.rs @@ -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; }