Shaders: s_min/s_max set SCC from the comparison; v_readlane/v_writelane lanes wrap (port of avatarmanz#404) #71
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/71"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by simbaui4life on 2026-11-27T16:14:36Z.
A port of avatarmanz/VIctory-7900XTX#404, review fix included. Two commits on
d12eb1b.Cause
s_min_{i,u}32/s_max_{i,u}32set SCC when S0 is chosen. The lowering gave no SCC of its own, so the genericD != 0was used. Ans_cselectors_cbranch_sccafter a min/max then took the wrong side whenever the two disagree, for examples_min_u32 s0, 5, 3: SCC 0 on the console, 1 here.v_readlane_b32/v_writelane_b32take the lane from S1[4:0] (wave32) or S1[5:0] (wave64). A select past the wave read the wrong lane or wrote no lane here.unspillmatched constant lanes before they were wrapped, so in wave32 lanes 36 and 4 were two slots. UwUCammie found this; their version is in jtrudeau1530/VIctory-7900XTX#38.What this does
emit/lower.rs: min/max return the comparison as SCC, and readlane/writelane mask a console lane withwave - 1. Host lanes (MaskData::Host) are unchanged.ir.rs:lane_wrapped_fieldswraps constant lanes beforeir::buildandunspillsee them.Tested (RTX 4070 Ti, driver 621.01)
a_constant_lane_past_the_wave_is_its_lane_modulo_the_wavefails without the change.-D warningsis clean.Not tested: in the game (no game data here).
No game data in the commits.
🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-27T16:31:14Z.
Review: APPROVED
LGTM — verified on Windows (RTX 5090):
SCC = Some(t)fors_min_*/s_max_*and maskingv_readlane_b32/v_writelane_b32lanes towave - 1(both inlower.rsand inir.rs::lane_wrapped_fieldsbeforeunspill) matches RDNA2 ISA semantics cleanlycargo test -p victory-shader --lib ir::(11/11, includinga_constant_lane_past_the_wave_is_its_lane_modulo_the_wave) andemit::tests::(21/21) passedcargo clippy -p victory-shader --all-targets -- -D warningspassed with 0 warningscargo xtask policypassed (279 files ok)Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Pull request closed