Repository navigation
d3d12: make a list hold the console structure buffer it binds - #644
Merged
Merged
Conversation
A walk is given the buffer of console-format structures by address. The buffer grows by being made again, larger, and the smaller one is given back after a rest: a list recorded before the growth and run long after it would read a buffer already released. The list now keeps the buffer among the resources it holds until it is reset.
There was a problem hiding this comment.
🔵 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:
- Retrieves the buffer and its GPU address together under the heap lock.
- Retains the buffer in both binding paths, falling back to the empty buffer if retention fails.
- Keeps the existing 64-present retirement delay as a secondary safeguard.
| File | Description |
|---|---|
runtime/d3d12/src/device/console_heap.rs |
Returns a retained buffer reference together with its GPU address. |
runtime/d3d12/src/commands/recording.rs |
Passes the list’s resource collection into console-scene binding. |
runtime/d3d12/src/commands/compute_bindings.rs |
Holds bound console buffers in the list’s resource collection. |
Review effort: Balanced
1 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.