Shaders: a descriptor picked from the view heap reads its own dwords #127
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/127"
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 Zettrox/ztrx. Originally posted by starnotes-xj on 2026-11-25T13:13:59Z.
The console compiler loads a descriptor from the view heap and reads its words as numbers: the record count (to bound a walk), the format and type (to pick a path), the buffer's address (to hand to
s_load). Translated code served only the root-table form of that (USER_VIEW_ADDRESS) and refused every heap form witha descriptor read only as data— 40 programs of the title's pack, among them the sevenPS_PuddleDetectvariants and the fiveshadowmask:CS_TraceShadowRays_*programs.Now the host keeps a table of four dwords a view-heap slot — the title's own console descriptor words (the buffer's address, its record count, and its format and type) — filled as it makes each slot, bound as root SRV
t252(SLOT_VIEW_WORDS). Zeros stand for slots without a buffer view; dwords past the fourth still stop the program, by name.Measured (
victory translateovershaders.rpf, 26,503 containers)victory translate --validate --pipelineson the dumped containers (RTX 4060 Laptop):PS_PuddleDetect#8660e9822ebe4b62andCS_TraceShadowRaysEighth/Quarter/Half (#96ccb14ef981fd85,#0e64f14fae060d04,#002e93a6cc2aa355) emit, validate withdxil.dlland get their D3D12 pipeline.CS_TraceShadowRays_Full(#07c93bfb77fecebb) validates but the host refuses its pipeline (E_INVALIDARG — upstream's0x80070057refusal for one compute program);FullAdaptiveis still stopped later, by a lane mask read as data.Tests
cargo test -p victory-gpu --release: 112 passed.cargo test -p victory-shader --release: 211 passed, 2 ignored.cargo clippy --release -p victory-shader -p victory-gpu: clean.Cost
Four dwords a slot (32 MB) per view heap, made with the heap. It could be made on first use if that matters; a title without such shaders never reads it.
Not yet run in the world: the next run will show whether the ray-traced shadow mask programs now produce shadows.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.