shader: size compute root constants from the pipeline's root signature #114
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!114
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-114"
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?
@Olima34 on GitHub · 2026-11-26 17:07 UTC · original
Olima34:feat/compute-root-constant-counts→main· +311 −32 · 6 files · 1 commits · merged 2026-11-26 17:16 UTCFollow-up to
d02869f, as discussed on #4: compute root constants take their exact size from the pipeline's root signature instead of the guess.Why. An FSPX metadata record gives a root parameter's first user-data dword, not its size.
d02869fguesses the size as "up to the next slot's first SGPR, or 1 for a trailing block". That guess is wrong after a gap (it takes the gap's SGPRs) and for a trailing multi-dword block (it stays 1 dword).What.
pipeline::create_compute_pieces(0x218): whendesc's root signature is one of ours, its blob (root::blob_of, read back from the objectroot::createmade) goes into the FSPX part as one more entry of our own,native::FSPX_ROOT_SIGNATURE(RTS0).native::fspx_programtakes each record'sNum32BitValuesfrom it (RTS0 1.0 to 1.2, bare or in a DXBC container).metadata_resourcesnow takes the size per slot instead of a bool.root type 0:root constants the root signature does not size;root constants overlapping another root parameter;root constants past the user SGPRs.Guess (marked in code and docs). The console puts all N dwords of a constant in consecutive user SGPRs from the record's dword. The checks above catch a count that contradicts the other records or the SGPR count.
Tests.
compute_root_constants_reach_the_user_data: a 4-dword block followed by a gap; dword 2 (s6) is read. With the root signature, it maps to slot 1 dword 2. Without it, the guess sizes the block at 1 dword and s6 is refused.root_signatures_keep_their_blob(macOS).compute_containerwith and without the entry.victory-shader and victory-gpu tests (arm64), Windows clippy and
cargo xtask policypass. Not verified in game (I don't have it yet): a story-load run should show noroot type 0refusals and no change in the shaders that already translate.@LakshanSivakumar on GitHub · 2026-11-26 17:17 UTC · original
Merged in
182c14f. The root-signature sizing, the three refusal reasons, thed02869ffallback and the cache keying all read correctly, and the new tests pass. Thanks!