perf(victory-gpu): reuse capped thread-local scratch buffer in texback::land_tiled #418
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/418"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-26T18:01:03Z.
Summary
Reuses a capped thread-local scratch buffer for tiled texture readbacks in
third_party/victory/crates/victory-gpu/src/texback.rs:land_tiled:land_tiledallocated and zeroed a freshvec![0u8; back.size]on every non-packed texture readback (e.g. padded linear or swizzled ocean readbacks).TILED_SCRATCHbuffer (TILED_SCRATCH_CAP = 4 MiB), dropping oversized buffers immediately on return so idle threads never retain large allocations.padded_linear_readback_reuses_capped_cpu_scratchverifying consecutive padded readbacks preserve row padding and reuse the same thread-local scratch allocation.Verification
cargo test -p victory-gpu --lib texback::tests(default and--features diagnostics)cargo xtask policyinsidethird_party/victory