Shaders/resource: do not treat RootType::Constants dword 0 as an address base in Tracer::sum #806
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!806
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-806"
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?
@AscilCH on GitHub · 2026-11-25 08:19 UTC · original
AscilCH:fix/shader-resource-sum-constants-dword0→main· +71 −7 · 1 files · 1 commits · openSummary
Fix
Tracer::sum()incrates/victory-shader/src/resource.rsmisclassifying dword 0 ofRootType::Constants(andRootType::Other) as an addressbase:Tracer::sum()matchedself.param_of(reg)againstSome((_, 0))without checkingself.layout[param].root.s_add_u32 s4, s0, s2) hitx.base.is_some() && y.base.is_some()and discarded the base. On compute shaders,by_address()silently rewrote the root-descriptor load to rawMEMORYinstead of the bound root buffer; on graphics/mesh stages it failed compilation.soffsetor flatvaddrfailed with"an offset from a root parameter", breakingroot_indexed_view'sshift = 0path.baseclassification inTracer::sum()to address-bearing root parameters (Table | ResourceHeap | SamplerHeap | Descriptor), and preserve"an address from a root parameter that is no address"inwhy_no_base()when a non-address root parameter is used directly as an address base.resource::tests::root_constant_dword0_is_dynamic_offset_not_address_basecovering both compute-shader root descriptor indexing and unshifted SMEMsoffsetroot-indexed views.Verification
cargo test -p victory-shader --locked -- resource:::34 passed; 0 failed; 0 ignored.cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings: 0 warnings.cargo xtask policy:171 files ok.(AI-assisted; synthetic unit tests only, no game data.)
@MamaLeVrai on GitHub · 2026-11-25 09:54 UTC · original
Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head
8e1b61eintomain9376fd6in a throwaway tree (no conflict).cargo clippy --workspace --all-targets --locked -- -D warningsfails, with the same two errors asmainitself on this machine (function placed_filler_twins is never used,field depth_written is never read,victory-gpu): this PR adds none and removes none.cargo test --workspace --locked: 541 passed, 0 failed, 10 ignored, two runs (mainalone: 540 passed). The title was not run, so this says nothing about in-game effect. No game data.AI-assisted (Claude Code); no game data.
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.