Merge pull request #3017 from DanielGodriNeto/perf/sprite-pixels-shrink

perf(assets): drop the spare capacity of the sprite pixel buffer
This commit is contained in:
rdbt
2026-10-28 00:37:35 +00:00
committed by GitHub
+2
View File
@@ -218,6 +218,8 @@ impl RenderAssets {
sprites.insert(root, &format!("minecraft:block/destroy_stage_{stage}"))?;
}
sprites.finish();
// `finish` grows the buffer by doubling: keep only the bytes in use.
sprites.pixels.shrink_to_fit();
Ok(Self {
sprite_size: sprites.size,
sprite_minimum_size: sprites.minimum_size,