d3d12: give placed textures memory at first GPU use #378
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/378"
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 brcly/TuxBox. Originally posted by NathansDomainSolutions on 2026-11-28T07:37:18Z.
Part of #292. This is the first of the two changes the issue's measurements point to: a native copy of a guest texture now gets graphics memory when GPU work first uses it, not when the title creates a view over it. @JeffreyBytes offered to test a branch in this direction on the RX 6700 XT, so this branch is for that. It does not bound the publication readback. That is the narrowing work in #300 and is separate.
What changes
64KB_UNDEFINED_SWIZZLE, with the same flags and state as before) and holds no memory.UpdateTileMappings. This runs on the placement upload queue, before any upload into the image. The guest queue's existing wait on the upload fence orders its work after the mapping.placement::submit(descriptor-heap reads, render targets, copies and bundles all end up intextures/writes) or throughPlacementMemory::flush_textures. Both callTransfer::backfirst, so the GPU never reads an unmapped tile.TUXBOX_LAZY_TEXTURES=0makes every placed image committed, as before. It's documented inENVIRONMENT.md, and the #292 bullet inFOCUS.mdis updated.lazy placed textures after … #N: R reserved (MiB), B backed (MiB). The gap between the two figures is the memory no longer held.Nothing evicts an image once it is backed. Images the title uses still hold memory as before.
Checks run
RTX 4070 (
10de:2786), driver 620.73.04, GE-Proton11-14, Linux 7.3.6, branch oncba382c.python tuxbox.py check --no-gpu: all 7 groups passed.python tuxbox.py verify --only d3d12-placement --only lanes-selftest --only lanes --only guest-frame --only present --only d3d12-heaps --only d3d12-copy-resource: 35 of 35 passed. That includeslanes-selftest-texture-publication,-texture-readback,-shared-textureand-copy-memory, which upload into, write back from and copy through placed images.python tuxbox.py run --app-id Lanes build/lanes --selftest allwith the provider log on:passed=26. The log shows the reserved path itself being taken: three images reserved, then each backed on first use, with no refusals.tools/check_d3d12_regressions.py(default cases): tables, heaps, placement, stream, frame, indirect, null-usage and null-disabled all passed.Still missing:
AI-assisted: written with Claude Code (Claude Opus 5.5). I reviewed the change and ran the checks above.
🤖 Generated with Claude Code
Imported from brcly/TuxBox. Originally posted by NathansDomainSolutions on 2026-11-28T09:32:12Z.
In-game numbers from ProjectScarlett 1.0.2.1 on the RTX 4070 (12 GB, driver 620.73.04, GE-Proton11-14) with this branch's provider staged. The run reached the title screen ("ACCOUNT PICKER / SCREEN NARRATION / TUXBOX") and accepted A there. The provider's own counters at that point:
The title had created 1,024 placed images worth 1.35 GB of graphics memory, and only 5 of them (6 MB) had been touched by GPU work. On
main, all 1.35 GB would be committed at this point. No reserved-image refusals were logged, and no placed-texture errors.That's as far as the run got. After A, it stayed on the title screen at one frame per second with the GPU idle, which isn't related to this change (it happens before any of these images are used). So I don't have numbers for the world yet, where #292's table says most of the memory is.
(Measured with Claude Code assisting.)