Shaders/io+native: prioritize VS fetched attributes over hardware IDs, check VGPR overflow, and clamp thread_id_vgprs #677
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/677"
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-25T04:20:52Z.
Summary
Fixes three I/O-raising and shader-metadata bugs in
crates/victory-shader:Silent VS attribute shadowing by hardware IDs (
crates/victory-shader/src/io.rs):VsInput.vgpr + channel, legitimately reusingv0..v3whenSV_VertexID/SV_InstanceIDare not needed afterwards.io::raisepreviously appended fetchedinputsafter(V(0), VertexId),(V(2), PrimitiveId),(V(3), InstanceId)while looking up with first-matchloaded.iter().find(...), silently lowering fetched attributes inv0/v3asSV_VertexID/SV_InstanceIDand aborting onv2(Input::PrimitiveId).inputsare now registered before the hardware fallback VGPRs.Unchecked
u8VGPR overflow on malformed FSSM (crates/victory-shader/src/io.rs):i.vgpr + channelcould panic in debug or wrap in release whenvgpr >= 253with upper mask bits set. Replaced withchecked_add, returningErr(ShaderError::Malformed("vertex input VGPR out of range")).Out-of-range 4th thread-ID dimension (
crates/victory-shader/src/native.rs):ComputeIo::thread_id_vgprs()returned4when 2-bitTIDIG_COMP_CNTwas3, emitting invalidInput::ThreadIdInGroup(3)(dx.op.threadIdInGroup(95, 3)). Clamped via((self.rsrc2 >> 11 & 3) as u8).min(2) + 1to match its1..=3contract.Verification
cargo test -p victory-shader --lib --locked -- io::tests native::tests— 18 passed, 0 failed (including newvs_fetched_attributes_in_v0_to_v3_override_hardware_ids_and_reject_vgpr_overflowandcompute_thread_id_vgprs_is_clamped_to_three_dimensions)cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings— clean (0 warnings)cargo xtask policy— asset policy: 169 files ok(AI-assisted; synthetic unit tests only, no game data.)
Imported from fxceless/victory-fork. Originally posted by JRamos1993 on 2026-11-25T05:27:29Z.
Offline check on the retail shader pack: this changes no emitted shader of the title.
victory translate --validate --listover the title's full shader pack (26,084 programs, 14,247 vertex and pixel programs with I/O raised) on an RTX 5090,main310c6ebagainst this head merged onto it:So in this title no vertex program's fetched attributes land in
v0–v3where the order would matter. The batch tool raises I/O from each container's own data, so this covers the containers as shipped, not anything a pipeline adds at run time.AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.
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.