shader: export only the enabled channels in pixel_aot compressed exports #392
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/398"
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 R0Y00/Xbox2Windows. Originally posted by abilliontokens on 2026-11-22T00:20:25Z.
Change
Refs #361 — stage 1 only (compressed
mrt0exports with EN ∈ {0x3, 0xC, 0xF}), per the issue's proposed split; stages 2–3 stay with the proposer.Depends on #363 (
shader/pixel-fp-mode), which must land first: this branch stacks on its export-branch rework and case-file trailer. Until #363 merges, the diff againstmainincludes #363's commits; the incremental change is the single commit on top.lower()gains keyword-onlyreturn_write_mask=False; withTrueit returns(hlsl, channel_mask). Default callers are unchanged. Two new anchored branches accept the LLVM-normalized partial compr formsexp mrt0 vA, vA, off, off done compr vm(mask 0x3) andexp mrt0 off, off, vB, vB done compr vm(mask 0xC), with the same guards as the 0xF branch. Partial exports still returnfloat4: the enabled pair viaexport16, disabled channels emit0.0fwith a comment that the PSO write mask prevents those writes.RenderTargetWriteMask[0]. Case-file trailer flags byte: bit 0 = integer RT (#363, unchanged), high nibble = RT0 write mask (0 → default 0xF; only 0x3/0xC/0xF accepted, other nibbles and low bits 1–3 are format errors). No-trailer files behave exactly as before.(-1, 2, -3, 4); enabled channels compare bit-for-bit against the CPU reference, disabled channels must still hold the sentinel. Full-mask clears are unchanged.offin the uncompressed form (stage 3), partial mask +integer_export, andwrite_mask+integer_rtcases.v16, off, off, offprints asv16, v16, off, off(0x1→0x3),off, v16, off, offprints all-off (0x2→0x0),off, off, v17, offprints asoff, off, v17, v17(0x4→0xC). {0x0, 0x3, 0xC, 0xF} are the only distinguishable compr masks in LLVM 15 text, so stage 2's half-pair masks need a raw-encoding investigation; recorded indocs/experiments.mdand on the issue.check_binary's LLVM 15 round-trip list.Verification
Environment: Windows 11 Pro build 26200.9711, MSVC 14.44.35207 (VS 2022 Build Tools 17.14), Windows SDK 10.0.26100.0 (its DXC), CMake 4.4.3 / Ninja 1.13.2, Python 3.12.10. Adapters: AMD RX 9060 XT (32.0.32029.2010), NVIDIA RTX 5060 Ti (32.0.16.2124), in-box WARP 10.0.26100.9711. Debug layer unavailable (Graphics Tools not installed); runs report
debug_layer=unavailable. LLVM 15.0.7 official win64 binaries (installer omitsllvm-mc; assembly via clang 15.0.7's integrated assembler through a local argv wrapper, disassembly viaLLVM-C.dll15.0.7).Result at this branch (rebased onto
mainat4f6c39dvia #363; isolated worktree configured with thedevpreset, ctest via--test-diron that build, same filters):pixel_aot_check.py binary(LLVM 15.0.7 round trip, all fixtures incl. the three compr EN programs)pixel_aot_hardware(default adapter, RTX 5060 Ti)pixel_aot_warp(WARP 10.0.26100.9711)pixel_aot_hardwarewithXBOX2WINDOWS_ADAPTER='RX 9060 XT'pixel_aot_hardwarewithXBOX2WINDOWS_ADAPTER='RTX 5060 Ti'tests/form_coverage_check.pyEnabled channels match the reference bit-for-bit and disabled channels hold the sentinel on all three backends; both negative controls report
pixel_mismatchon every backend. Capability skips: none in this group.Negative controls (fail on every backend): the partial-mask shader drawn with an all-channels PSO against the sentinel-expecting reference (the immaterial
0.0flands in disabled channels →pixel_mismatch), and a corrupted enabled-channel reference.Evidence and follow-up
docs/experiments.mdrecords the write-mask pipeline-state contract, the trailer nibble, the sentinel rule, the LLVM normalization finding, and the remaining rejections.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by MoonYueya on 2026-11-22T00:21:36Z.
I have sleep🥰
Imported from R0Y00/Xbox2Windows. Originally posted by abilliontokens on 2026-11-22T00:32:29Z.
ur going to sleep? good night
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T05:13:45Z.
One integration guard before the stage-1 patch lands: the new high-pair path emits zeros for the disabled channels but currently also returns only HLSL when
return_write_maskis false. That lets the normal caller draw zeros into channels the guest did not write. Require the explicit write-mask return on newly accepted partial forms, and add a default-call rejection control for the high pair. Preserve any existing low-pair caller behavior. Please keep the PSO-mask and sentinel controls, and limit this branch to comments and code for the normalized paired forms. The raw EN cases stay in #434; a normalized disassembly string alone cannot establish support for a non-paired mask.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T05:48:52Z.
I pushed
2614f22to resolve the conflicts and preserve the existing float2 path. The high-pair export requires the explicit RT0-mask result. The new focused draw passed on WARP and hardware under/O2: RG, BA and RGBA matched their references, both partial masks preserved the clear sentinels, and the full-mask and wrong-value controls failed as expected. Waiting for the fresh CI, including the LLVM 15 round trip.