Shaders/resource: do not treat RootType::Constants dword 0 as an address base in Tracer::sum #805
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from fxceless/victory-fork. Originally posted by AscilCH on 2026-11-25T08:19:22Z.
Summary
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.)
upstream-sync referenced this pull request2026-11-25 10:10:58 +00:00
Imported from fxceless/victory-fork. Originally posted by MamaLeVrai on 2026-11-25T09:54:06Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.