Shaders: s_min and s_max set SCC to their comparison #1891
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1891
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1891"
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?
@Melow-code on GitHub · 2026-11-29 01:46 UTC · original
Melow-code:scalar-min-max-scc→main· +29 −2 · 2 files · 1 commits · merged 2026-11-29 02:13 UTCFixes the flag left by the scalar minimum and maximum.
What it changes
s_min_i32,s_min_u32,s_max_i32ands_max_u32set SCC to the comparison of their operands (RDNA 2 ISA:SCC = (S0 < S1),SCC = (S0 > S1)). The lowering set it to "the result is not zero", so ans_cselector a branch behind one could take the wrong side:s_min_u32 s0, 5, 3gave 1.Two lines in
lower.rs, and a test of the four opcodes: zero results, equal operands, signed and unsigned orders.Credit: the fix and the test table are from TaynanGT/Vice-Tay 3c83a339 (reported in Belobug/VIctory-Belobug-AMD#634 and avatarmanz/VIctory-7900XTX#404). The same defect was in #71, reviewed and then closed by its author.
How it was tested
scalar_min_max_pass_the_comparison_to_conditional_selectfails on the card (hardware, opcode 0x6, case 0: 0 instead of 1).cargo test -p victory-shader --libon Linux, on main0338ec6c: 268 passed, 0 failed. The card test was run onf9dfb76fwith the same change (the test above is Windows only). The test programs were cross-built with Rust 1.99.1 GNU, not the pinned 1.98.1 MSVC. The whole Windows suite was not completed on this branch.Checked for overlap
🤖 Generated with Claude Code
[pr-fix] Shaders: s_min and s_max set SCC to their comparisonto Shaders: s_min and s_max set SCC to their comparison