startup: src_scc is refused as an unknown scalar operand (1 of the remaining loading-screen shader refusals) #1820
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#1820
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@triggered02 on GitHub · 2026-11-24 19:14 UTC · original
Found in the refusal census (#870). 1 refused shader:
Problem
Scalar source code 253 (
src_scc) reads the SCC bit as the integer value 0 or 1. The translator refused it as an unknown operand, becauseStage.u()only understood registers, inline constants andm0.Fix
The generated shader already carries SCC as a
bool scc(initialised, and updated by the scalar instructions that set it), so the source lowers to a conditional:Measured on
mainat813045b3:s_mul_i32 s28, 1.0, src_sccs28 = 0x3f800000u * (scc ? 1u : 0u);s_and_b32 s28, src_scc, s5s28 = (scc ? 1u : 0u) & s5; scc = s28 != 0;The census form multiplies the raw bits of the inline float
1.0(0x3f800000) by the SCC bit — that is what the scalar integer multiply does, and it is why the constant is not emitted as1u.Test
startup_gfx2hlsl_src_sccbuilds SOP2 encodings from the checked-in decoder's layout ([31:30] == 0b10, opcodew0[29:23], destinationw0[22:16], src1w0[15:8], src0w0[7:0]), decodes them, then translates. Five checks: the census form decodes and lowers,src_sccworks in the first source position as well, a bitwise op still updates SCC, and a definition followed by a use emits both statements (scc = s28 != 0;thens29 = 0x3f800000u * (scc ? 1u : 0u);).Fail-first, both caught:
Pre-existing failures, not from this PR
startup_gfx2hlsl_mad_preserve_{warp,hardware}fail in this dev tree withUnknown GPU operation or invalid arguments: --raw-uav-dump-sm62— the builtoffscreen_checkis stale. Confirmed identical onorigin/mainwith the same binary. A rebuild fixes it; this branch does not touch that tool.What this does not establish
s_cselect-style conditional uses of SCC (condoperand) are separate and already handled.AI-assisted (Claude Code).
@ChazY11 on GitHub · 2026-11-24 20:24 UTC · original
Taking this one, with the approach the issue describes:
u('src_scc')→(scc ? 1u : 0u), the two census forms as the positive cases, and a device-free check that builds the SOP2 words from the decoder layout, decodes, and translates. If you already have a branch for it, say so and I will drop mine.I will report the fail-first runs (guard removed, both forms) and the
startup_gfx2hlsl_*neighbours in the PR.@ChazY11 on GitHub · 2026-11-24 21:05 UTC · original
Withdrawing my #1896: #1821 by @triggered02 implements the same
Stage.u()branch and was opened 73 minutes earlier, sotheirs is the one to merge. I claimed the issue without noticing the branch already open on it — that was my miss.
The two things I verified and that #1821 should keep: the census form has to preserve the raw bits of the inline float
(
s28 = 0x3f800000u * (scc ? 1u : 0u);), and returning1uinstead of(scc ? 1u : 0u)is the mutation a fixture on thispath should catch. Details are in the closed PR.