Repository navigation
fix(shader): preserve channels across partial color exports (SHADER-422) - #2362
Conversation
An EXP component mask can write different channels of the same MRT across multiple instructions. Retain disabled components from that target so a later export does not erase color that an earlier instruction wrote.
|
Tested Independent Vulkan check of I split the PR's assembly fixture into two single-attachment draws for the stock
Each PR-head draw matched all 4,096 pixels, and the reverted translator cleared the previously written channels at every pixel. Both sets of modules passed SPIR-V validation. The 19 CPU tests in AI-assisted verification. |
|
Tested I used the original interleaved two-MRT fixture unmodified. A local
Each value held for all 256 pixels in that draw. Synthetic inputs only. AI-assisted verification. |
|
Independent Windows Vulkan verification for SHADER-422. AI-assisted with Codex. I assembled the stock synthetic
On both GPUs all 16 pixels read MRT0 Both unmodified fragment outputs, the control, and the fullscreen vertex shader passed |
|
Tested
AI-assisted (ZCode agent): builds and runs executed by a coding agent on this machine. |
…xports # Conflicts: # docs/design.md
Keep the targeted regression and the intervening upstream changes together for review.
|
Tested
That's not this PR. The wrong word is Update: confirmed. No game files. AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude Code). Synthetic shaders only, no game files. |
|
Tested
Not run: the PR merged with current main, AI-assisted (Claude Code). |
Claimed in the coordination issue as SHADER-422.
What and why
A later partial color export to an MRT zeroed the channels it left off. A shader that exported red/blue and then green/alpha lost red and blue. RDNA2 accumulates pixel exports, with individual component enables for ordinary exports and RG/BA pair enables for compressed ones. Preserve disabled components from that render target. Initialize partial outputs to zero to retain the previous result for channels never written. AMD RDNA 2 ISA, sections 11.1 and 11.2.1
Tested
49475796returned (0, 2, 0, 4) and (0, 0, 7, 8), matching 4/8 expected words. The patched shader matched all 8/8. The shader translated, assembled and passedspirv-val --target-env vulkan1.2on both revisions (1/1 before and after).AI-assisted with Codex.
Checklist
docs/design.md, with how it was confirmed.