startup: carry a compressed export's channel mask so 'off' channels are not written (7 of 29 loading-screen shader refusals) #1674
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#1674
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 16:49 UTC · original
Found while triaging the refusals in the first main-game loading-screen shader cache (#870). 7 of 29 refused shaders.
Correction to the earlier report
This issue was first filed as the SMEM offset operand
off, then corrected to the compressed export below. A pull request lowered the export form (#1693) and was closed after review found that lowering it alone changes what a draw writes: see "Why the lowering alone is unsafe" below. The remaining work is the write mask, not the lowering.The refusal
gfx2hlslrefuses anexpwhose unused channel pair is spelledoff, which is how a compressed export that writes only the first two channels is printed:Cause:
Stage.export()handlesoffin the non-compressed branches ('0u' if v == 'off' else ...) but thecomprbranch reads both source pairs unconditionally.Why the lowering alone is unsafe
comprpacks two channels per source register, sooffin the second pair means channels 2/3 are not written. The translator emits a fullfloat4MRT assignment, andsrc/startup_stubs/state_block_blend.hrecords thatCB_TARGET_MASKhas not been located, so every target keeps all four channels (D3D12_COLOR_WRITE_ENABLE_ALL). Substituting zero for theoffpair therefore overwrites channels the console shader leaves untouched — a silent content change on any target that already held data.Deliverable
Carry the export's channel mask into the translated PSO:
offsources, and from an expliciten:mask where present);RenderTargetWriteMaskfrom it when the console blend state does not provideCB_TARGET_MASK.Then the compressed export with
offchannels can lower, and an expliciten:mask stops being refused for lack of a consumer.Done when
offin either pair lowers, and the translated pipeline's write mask excludes exactly those channels.decode(), and checks both the lowered HLSL and the recorded mask.comprexports, unnamed formats, and any export whose mask cannot be represented.Not in this slice: which value a partially written channel should take, and the other refusal groups in the census.
AI-assisted (Claude Code).
@mumba17 on GitHub · 2026-11-24 19:38 UTC · original
This issue was closed at 17:07 by the commit for the SMEM
offfix (#1676). The compressed-export deliverable above is still open: onmainatecc6e6ce,exp mrt0 v0, v0, off, off done compr vmis still refused asoperand 'off'.Local count: on an RTX 3090 with a warm cache from the first-run setup through the post-confirm load, 16 of 110 refused pipelines stop at this export, and nothing earlier refuses them.
Claiming the deliverable as written above:
offpairs and an expliciten:mask;RenderTargetWriteMaskfrom it when the console blend state gives noCB_TARGET_MASK.Tests:
decode();Refusals kept: packed-integer
compr, unnamed formats, and masks that cannot be represented.@R0Y00, can this be reopened, or would you rather have a fresh issue for the remaining slice?
AI-assisted (Claude Code).