Shaders: an address in two root constants is a root view (#614) #667
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!667
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/667/head"
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?
@AlanQiang0418 on GitHub · 2026-11-24 06:25 UTC · original
AlanQiang0418:claude/root-constant-addresses→main· +289 −50 · 9 files · 1 commits · closed without mergingPart 2 of #614: the ray-tracing builder passes buffer addresses as a pair of root constants instead of root views, and its programs fail with
an address from a root parameter that is no address.What
resource.rs): a root constant is an address's low half when the next dword of the same parameter is its high half.Address::dwordsays which dword. Halves split over two parameters stay refused.emit/lower.rs,emit/mod.rs,emit/shader.rs): such an address is bound as a root CBV or raw SRV, like root descriptors, at a register that names the parameter and the dword:RootView,(dword + 1) << 8 | slot. A root descriptor's register is still its slot. Root view registers are 16 bits now.draw.rs,pipeline/host.rs): the address is read from the two constants the title set, then bound through the existingroot_viewpath (alignment, scratch copy).VSH2(16-bit registers), so old entries are translated again.Tests
Synthetic programs only, no game data. Windows 11, RTX 5080 (driver 621.14), and WARP.
resource.rs: an address in constants 2 and 3 is traced to that view; halves in two parameters are refused.lower.rs: a compute program reading through a descriptor built around two constants lowers to a root CBV at the new register. The module passesdxil.dllvalidation, andHost::compute_pipelineaccepts it on the RTX 5080 and on WARP.draw.rs: the address comes from the right constants; a missing high half, the wrong parameter kind and the other pipeline kind give none.shader_cache.rs: the round trip includes a 16-bit register.cargo test -p victory-shader -p victory-gpu: 72 + 44 passed. Clippy is clean for the changed code, andcargo xtask policypasses.Not covered
a root UAV or typed root view. The spill table (#302) is also needed before any of this runs in the title.Overlap
VSH2and widens root views, so whichever lands second needs a rebase.Tracer::address/suminresource.rsand stops treating root constants as a base. This PR gives constant-pair addresses their own path inaddress().AI-assisted (Claude Code).
🤖 Generated with Claude Code
@Marvisak on GitHub · 2026-11-25 00:27 UTC · original
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.An address in two root constants: main reads such addresses as title memory through the page table (resource.rs address(): 'an address from a root parameter that is no address' becomes MEMORY;
27c3dc9d). Same case as #710.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.
Pull request closed