shader: accept partial channel masks on uncompressed pixel_aot exports #429
No reviewers
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!429
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/429/head"
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?
@abilliontokens on GitHub · 2026-11-22 01:45 UTC · original
abilliontokens:shader/exp-enable-mask-uncompressed→main· +57 −20 · 5 files · 6 commits · merged 2026-11-23 08:24 UTCChange
Refs #361 — stage 3 (non-compressed 32-bit exports with per-channel
offmasks), per the issue's proposed split. Depends on #398 (shader/exp-enable-mask, stage 1), which itself depends on #363; this branch stacks on #398's head and must land after both. Until they merge, the diff againstmainincludes their commits; the incremental change is the single commit on top.lower()now acceptsoffin any operand of the uncompressed exportexp mrt0 vA, vB, vC, vD done vm. Each enabled operand must be a distinct sample/alu register; the four enable bits form the channel mask reported byreturn_write_mask(so masks 0x1..0xE become reachable for this form, in addition to 0xF). Disabled channels return0.0fbehind the same immaterial-values comment as stage 1, since the harness blocks those writes with the PSO'sRenderTargetWriteMask[0]. An all-off export (mask 0) is rejected, and a partial mask combined withinteger_exportis rejected (out of scope); the full-mask integer path is byte-identical to before.offinside a compressed export and half-pair text such asv16, off, off, off done compr vmremain rejected. LLVM 15 normalizes compressed half-pair enables to whole pairs, so they are unexpressible in disassembly text (stage 2 stays dropped).write_case(write_mask=...)accepts any nonzero nibble 0x1..0xF, and the renderer accepts any nonzero trailer nibble (0 keeps the all-channel default), clearing to the sentinel (-1, 2, -3, 4) for every partial mask. Cases written without a trailer keep the original 1280-byte format byte-identically.uncompressed_export(body, mask)builds the per-channel-off text; masks 0x1, 0x8, 0x5, 0xA joined the LLVM 15 assembler round-trip list incheck_binary.check_exp_mask_uncompressed_drawdraws masks 0x1, 0x8, 0x5, 0xA, 0xF with distinct per-channel constant words throughv_sub_f32: enabled channels compare bit-exactly against the reference on the R32G32B32A32 target, disabled channels keep the sentinel. Two negative controls must reportpixel_mismatchon every backend: the EN=0x5 shader drawn under an all-channel PSO write mask against the sentinel-expecting reference (receives the immaterial zeros), and a corrupted enabled-channel reference. Rejection controls coveroffin a compressed export, compressed half-pair text, the all-off uncompressed export, a duplicated enabled register, and partial mask +integer_export.Verification
Windows 11 x64 build via
tools/dev.ps1(MSVC),cmake --preset dev -B out/build/dev-361s3 -DINTAKE_PYTHON=out/pe-env/Scripts/python.exe, then:cmake --build out/build/dev-361s3out/pe-env/Scripts/python.exe -B tests/pixel_aot_check.py binary <llvm-mc.exe> <llvm15/bin/llvm-objcopy.exe> <llvm15/bin/LLVM-C.dll>ctest --test-dir out/build/dev-361s3 --no-tests=error -R "^pixel_aot_"pixel_aot_warp,pixel_aot_hardware)$env:XBOX2WINDOWS_ADAPTER="RX 9060 XT"; ctest ... -R "^pixel_aot_hardware$"$env:XBOX2WINDOWS_ADAPTER="RTX 5060 Ti"; ctest ... -R "^pixel_aot_hardware$"out/pe-env/Scripts/python.exe -B tests/form_coverage_check.pyform coverage checks passedctest --test-dir out/build/dev-361s3 --no-tests=errorbvh_wave64_hardware,bvh_wave64_warp,wave_shuffle_warp)pixel_mismatch; rejection controls raise before any program is recorded for coverage. Sentinels: enabled channels bit-exact, disabled channels hold (-1, 2, -3, 4).Environment
bin/10.0.26100.0/x64/dxc.exe(dxcompiler 1.8.2502.11),-denorm preserveatps_6_2.Evidence / follow-up
exp mrt0 v12, off, off, off done vmand the mixed forms reassemble bit-identically, so per-channelofftext is authoritative for the uncompressed form (round-trip fixtures pin this).mrt1+,mrtz,null), exports withoutdone vm, multiple exports, partial mask + integer export.@R0Y00 on GitHub · 2026-11-23 07:06 UTC · original
I pushed
b639001after #434 merged. Partial uncompressed exports require the explicit floating-point RT0 mask, with the ordinary API and integer export both refusing them. LLVM 15 and the WARP and hardware Release draws passed for both compressed and uncompressed fixtures. The uncompressed references retain bits below binary16 precision and detect both a wrong PSO mask and a wrong enabled-channel value. Waiting for the final CI.