d3d12: narrow a direct-indexed program's texture writes to what it can store through #303
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/303"
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-27T07:13:21Z.
Refs #215 (proposal in Discussion #300). Stacked on #301; the first two commits here are #301's.
A program under a root that allows direct heap indexing could, as far as the provider knew, write any texture in the heap. So every placed texture with a UAV in the heap counted as written by the batch, and each such batch read back, re-tiled and republished all of them to title memory. In ProjectScarlett on an RTX 5090 that was about 275 textures and 760 MB per batch, and most of the #215 stall.
This narrows the write set using what the console program itself states, keeping title memory identical to today:
dxbc: tell whether a console program can write an image,d3d12: only read the heap's textures …).dxbc: name the table descriptors …,d3d12: count only the table descriptors …). The analysis traces each store's descriptor back to a table load. A store through a heap index, or one it can't trace, keeps the whole heap written. In one recorded ProjectScarlett set, 1,355 of 1,409 storing compute programs and 1,123 of 1,417 storing pixel programs store only through table slots.s_setregdoesn't overwrite a scalar register. The decoder lists its source field as a destination, which lost the traced descriptor in 153 of 294 otherwise untraced pixel programs.Measured in ProjectScarlett's story intro, RTX 5090, 620.70.10: in the first world interval, 14,015 of 14,147 whole-heap draws and dispatches were narrowed. The stall isn't gone, though. The remaining un-narrowed draws still republish the whole heap, and the read-side snapshot compare is untouched. Discussion #300 covers that next step.
Tests (Lanes,
lanes-bindless-computesuite, each in a wide and a constrained heap):bindless-heap-read: a direct-indexed program with no image write; the title rewrites a heap UAV texture's memory while the dispatch is held, and those words must survive.bindless-table-store: a direct-indexed program storing through one table slot; that texture must reach title memory, and another UAV texture in the heap must keep the title's words.bindless-texture-store: a store through the heap still publishes, so this case keeps today's behaviour.On AMD (RADV), #301 plus only these Lanes commits fails
bindless-heap-readandbindless-table-storein both modes, and passes with this PR. There are also dxbc unit tests for each analysis, includings_setreg.Checks (on fdff12b; the tree differs from this branch only by #301's Lanes test)
python tuxbox.py checkpassed, 141 gates.python tuxbox.py checkpassed, 141 gates.🤖 Generated with Claude Code