Repository navigation
GPU: one aligned copy per unaligned SRV range per list (follow-up to #986) - #1260
DaemonSimon wants to merge 2 commits into
Conversation
Placed structured buffer SRVs sub-allocated inside a larger title buffer can land at shadow offsets not divisible by StructureByteStride (e.g. offset % 56 != 0 in GTA VI hit detection). buffer_srv() rejected these views, leaving null_buffer_view (zeros) in the host descriptor slot. Detect unaligned buffer SRVs, promote their descriptor table to fresh dynamic slots, copy their bytes at submission into an element-aligned upload scratch slice, and bind an SRV with FirstElement = at / element.
PR Marvisak#986 copied an unaligned buffer SRV's bytes into fresh scratch memory for every draw reading it: 286k copies (35 GB) in a few minutes of the world, GTT filled to 15 GB and RADV refused submissions (not enough memory, device removed). Draws of one list reading the same range now share one copy, kept until the list is reset. GTT stays at ~4.6 GB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verified on Win10 21H2 / RTX 3080 (driver 621.24) stacked with #986 and #1267: world went ~1 fps → 20 fps, copies 270–400 MB/frame → 0.4 MB, and the ~2–3 min device removal disappeared (0 in a ~2.3 min world run). Combined result and setup detailed on #986. AI use: Qwen Code (model name not disclosed); user-confirmed. |
|
Confirmed on Linux (
(Detailed A/B metrics posted in #1267 and #747. AI-assisted log summary; own retail copy, no game files or raw logs attached.) |
|
Automated triage for the maintainers. Closing because this change is already in Follow-up to #986 (one aligned copy per range per list); main keeps one copy per view range held by its slot (shadow::exact). If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
Depends on: #986 (this branch is #986 plus one commit; only the last commit is new).
What
#986 copies an unaligned buffer SRV's bytes into fresh scratch memory for every draw that reads it. In the world that adds up fast: about 286k copies (35 GB) within a few minutes. GTT filled to 15 GB, RADV refused further submissions ("not enough memory") and the device was removed.
This commit makes draws of one command list that read the same unaligned range share a single aligned copy, kept until the list is reset. The fix #986 brings (no shader reading address 0 through an empty view) is unchanged.
Result
Testing
cargo check -p victory-gpu --target x86_64-pc-windows-msvcon this branch (GPU: copy unaligned buffer SRVs into element-aligned scratch memory #986 + this commit) is clean.AI-assisted: written and tested with Claude Code.
🤖 Generated with Claude Code