d3d12: let an update in place take no more than the structure there #445
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/445"
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 NickStallman on 2026-11-29T05:00:14Z.
Summary
A structure in title memory reserves the space its build or copy takes, and a new one releases the older ones it covers. An in-place update was booked at the host's size for a full build. A title updates a compacted copy where it lies and packs the next one right after it, inside that size, so each update released its neighbour. A scene then lost that neighbour's instances, and the neighbour's own update found no structure and was built in full, over the first one in turn.
An update in place now books what the structure at its address already reserves (the smaller of that and the host size). Updates into another address, or where no structure lies, and full builds are unchanged.
Why it's sound
An update where a structure lies can't take more than that structure reserves. A copy stays booked at the 256-byte minimum, as on
main. A structure kept too long is one whose tail was overwritten beyond 256 bytes; a title naming it names overwritten memory on the console too, and a structure built there is published at its own address. The cost is storage held longer for copies the title has freed.Evidence (ProjectScarlett, RTX 5090, integration builds that don't include this change)
Not shown
Tested
Lanes:
ray-tracing-packed-updateis new. It fails onmain(28717263with this PR's Lanes change, AMD) and passes with the fix on both cards. It proves nothing on a driver where compaction saves no space.Three unit tests are new; two fail when the rule is removed. The project's checks only typecheck the D3D12 crate, so these don't run in
check.GPU, driver and backend:
Some of these ran while a game was loading its shaders on the 5090. Not run in the game with this change, or on Windows. #442 also edits
blas.rs; whichever merges second needs a small rebase.🤖 Generated with Claude Code