Repository navigation
GPU: refresh placed buffer tables after backing registration - #2158
andrewpozdnakov7-jpg wants to merge 3 commits into
Conversation
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC):
cargo test -p victory-gpu --features diagnostics --lib placed_buffer_tests— passed on RTX 5090cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (184 files ok)
Clean refresh of placed buffer tables after backing registration with end-to-end GPU test coverage. Looks good.
AI-assisted (Gemini 4 Neon).
A descriptor table is made afresh only when its slot reaches past the host heap. A placed buffer view keeps the same slot, but its backing copy changes once the title registers a resource at that address. Draws that reuse that table then read through the stale loose shadow, so the synthetic read-and-store shader writes zeros. The table-fresh path now also checks the slot when it holds a placed buffer view: if the copy the view would use now differs from the kept slot, the table is made afresh. The table key hashes the copy buffer too, so two tables with one record but different backing are distinct. From Marvisak/VIctory#2158 (GPL-3.0-or-later, by andrewpozdnakov7-jpg). Cherry-picked from 1bccc4f. Here, hand_out takes the title bytecode pointers as an extra argument, so the test passes &[]; it skips on this PC, where the runtime reports no SM 6.6 device.
|
Automated triage for the maintainers. Needs work (one point left). Thanks for
What still needs fixing is when a heap counts as idle. Each Not blocking: there is still no frame-time measurement of the remaining per-draw check, and no run linking this to the black cutscene frame in #850. Either would help the maintainer. CI: passing on the previous head. It merges cleanly. Generated by Claude Code |
Keep the old persistent descriptor while a recorded list can execute with its heap. Refresh only the placed buffer slots when an idle heap binds again after a buffer registration change.
The loose shadow outlives the draw test. Give it a mapped window for later memory submissions in the same process.
|
Thanks for the review. f325f85 refreshes the persistent placed-buffer slots when the first command list binds the idle heap after a buffer registration change. Earlier recorded lists keep the binding until reset or release, including a closed list that has yet to be submitted. Table arrays and bindless shaders can index beyond the explicitly named table entries, so this tracks the lifetime of the bound heap. A heap that stays continuously referenced still uses the temporary table for an affected draw until the heap becomes idle. The draw-time backing check now skips heaps with no placed buffers. On the remaining heaps, it checks the tracked placed slot set before decoding a view or looking up a shadow. Fresh tables retain backing identity in their cache key, including tables beyond the native heap limit. The same Windows/WARP test records a VIctory dispatch and reads the resulting texel. On main 940d32f, the existing slot read 0 after registration. On the previous PR head 1bccc4f, it read 1.25 through a temporary table even after the old lists retired. At f346d1d, it reads 1.25 through a temporary table while the older list can run, then reads 1.25 through the refreshed permanent slot. The test now lives under draw and uses writable pool memory. Its source keeps a complete loose-shadow window mapped for later tests. The full GPU suite passed on WARP with 147 passed and 2 ignored, including a run with the D3D12 debug layer enabled. Strict GPU Clippy in both configurations and the staged asset policy passed. The link to the cutscene in #850 remains open. If these changes are folded into another author's commit, please preserve attribution with this trailer: Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com |
Refs #850
A placed buffer SRV can already be mirrored against a loose shadow when the title registers a buffer for the same range. VIctory then refreshes the registered buffer, but the table still points at the loose shadow.
When the backing changes, make a command-list-owned table for the next dispatch and key it by the current backing. Earlier recorded work retains its original binding.
Verification
On upstream 940d32f, the same WARP regression read 0 from the existing descriptor after buffer registration and 1.25 from a newly created descriptor. With this commit, both read 1.25 through the usual VIctory dispatch and texture readback path.
GPU suite with the regression and diagnostics on WARP went from 146 passed, 1 failed and 2 ignored to 147 passed and 2 ignored. Strict GPU Clippy with diagnostics and staged asset policy passed.
This confirms the placed-buffer readback issue. Correlation with the black cutscene frame remains open.