diff options
| author | bobcatchris <83428450+bobcatchris@users.noreply.github.com> | 2026-11-29 23:02:49 -0600 |
|---|---|---|
| committer | bobcatchris <83428450+bobcatchris@users.noreply.github.com> | 2026-11-30 05:18:20 -0600 |
| commit | 7305728f5b9530839dc0b10bc6ed72a366a18d33 (patch) | |
| tree | 77aebe926b8ec67ae0ac07fc1782459224654a20 /runtime/src/thread_stacks.cpp | |
| parent | d367675c705c758f731ae9eb603839a4ebb2283c (diff) | |
leonida-gpu: reuse thread-local before snapshot buffer in texback::write (D3D12-GPU-TEXBACK-REUSE-BEFORE)
texback::write() already kept a thread-local TILED buffer (capped at 32 MiB)
to avoid per-landing heap allocations, but still allocated and freed a fresh
`let mut before = Vec::new()` on every LEONIDA_COPY_BACK read-back (~22/frame
in gameplay) to diff 4 KiB pages.
Pair `before` with `tiled` in a single thread-local SCRATCH `(Vec<u8>, Vec<u8>)`
(both capped at KEPT = 32 MiB) so copy read-backs reuse their snapshot buffer
without repeated multi-MB allocations/page faults.
AI-assisted: Antigravity (Gemini 4 Neon)
Diffstat (limited to 'runtime/src/thread_stacks.cpp')
0 files changed, 0 insertions, 0 deletions