d3d12: make a list hold the console structure buffer it binds #644
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/644"
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 3kynox on 2026-12-01T22:53:34Z.
Summary
Asked for on #586: a list that binds the buffer of console-format structures by address now holds that buffer.
The buffer grows by being made again, larger, and the smaller one is given back once the GPU is 64 presents past it. A list recorded before a growth and run later than that would read a buffer already released, the use-after-free class of #603.
console_scenesnow puts the buffer among the resources its list keeps until it is reset. It takes the buffer and its address together under the buffer's lock, in both paths: the walks that declare scene offsets and those given the buffer alone. A walk whose list has no room to hold it keeps its empty buffer.The 64-present rest stays, as a second guard.
Tested
No Lanes scenario and no unit test. Holding the buffer needs a real device's buffer and a recorded list: Lanes has no walk that reads console-format structures, and the unit tests have no hardware device. The change is 25 lines in three files.
GPU, driver and backend: RTX 4070 Ti SUPER 16 GB, 620.73.04, GE-Proton11-14, vkd3d-proton. Not run in the game: today's main stops in the title on this card with or without the switch (#625).
The
Evidence:linetuxbox.py checkprints last, one per card (it names the commit it tested; run it on this pull request's head):The one failure is
test_stage_baseline.GuestWatch, which fails on this machine on main too.Commands run and their results:
Checks
CI runs the code checks. No evidence JSON changes.
Imported from brcly/TuxBox. Originally posted by copilot-pull-request-reviewer[bot] on 2026-12-01T22:55:45Z.
Review: COMMENTED
🔵 Needs a closer look
The GPU resource-lifetime change lacks regression or runtime coverage for delayed submission across buffer growth and retirement, and required AMD hardware validation remains outstanding.
No open issues 🎉
What changed in this PR
This PR makes command lists retain the console-structure buffer they bind, preventing buffer growth and delayed execution from leaving a list referencing a released buffer.
Changes:
runtime/d3d12/src/device/console_heap.rsruntime/d3d12/src/commands/recording.rsruntime/d3d12/src/commands/compute_bindings.rsReview effort: Balanced