xshader: translate DPP16 quad permutations for bitwise operations #142

Manually merged
github merged 1 commit from gh-pr/142/head into gh-pr/142/base 2026-11-26 06:34:11 +00:00
Owner

@⁠smith-3 on GitHub · 2026-11-25 04:18 UTC · original
smith-3:codex/dpp16-bitwise-quad-perm → main · +142 −19 · 2 files · 1 commits · merged 2026-11-25 07:26 UTC

Fix DPP16 quad_perm translation for v_or_b32, v_and_b32, and v_xor_b32. These instructions can silently use the wrong lane. The fix reads the first operand from the selected lane and combines it with the second operand from the destination lane.

The change covers full row and bank masks without source modifiers. With FI cleared, an inactive source supplies zero when BOUND_CTRL is set and preserves the destination otherwise. Pixel shaders with FI cleared require a provable EXEC mask. The regression tests cover both FI and BOUND_CTRL settings and rejection of ambiguous pixel masks.

Synthetic GPU validation on an NVIDIA GeForce RTX 4080 SUPER

Stage Shaders GPU readback vs. CPU reference
Compute 39 2,496 / 2,496 output words matched bit for bit
Pixel 36 1,644 / 1,644 drawn pixels matched bit for bit, and all 7,572 guard pixels kept their clear value

Recompiling all 75 cases from this branch reproduced the tested DXIL byte for byte. All five checks in the contribution guide passed locally.

@⁠brcly, could you review the inactive-source handling, especially the pixel EXEC check?

Refs #16.

**@⁠smith-3** on GitHub · 2026-11-25 04:18 UTC · [original](https://github.com/brcly/TuxBox/pull/142) `smith-3:codex/dpp16-bitwise-quad-perm` → `main` · +142 −19 · 2 files · 1 commits · merged 2026-11-25 07:26 UTC Fix DPP16 `quad_perm` translation for `v_or_b32`, `v_and_b32`, and `v_xor_b32`. These instructions can silently use the wrong lane. The fix reads the first operand from the selected lane and combines it with the second operand from the destination lane. The change covers full row and bank masks without source modifiers. With FI cleared, an inactive source supplies zero when BOUND_CTRL is set and preserves the destination otherwise. Pixel shaders with FI cleared require a provable EXEC mask. The regression tests cover both FI and BOUND_CTRL settings and rejection of ambiguous pixel masks. **Synthetic GPU validation on an NVIDIA GeForce RTX 4080 SUPER** | Stage | Shaders | GPU readback vs. CPU reference | | --- | ---: | --- | | Compute | 39 | 2,496 / 2,496 output words matched bit for bit | | Pixel | 36 | 1,644 / 1,644 drawn pixels matched bit for bit, and all 7,572 guard pixels kept their clear value | Recompiling all 75 cases from this branch reproduced the tested DXIL byte for byte. All five checks in the contribution guide passed locally. @⁠brcly, could you review the inactive-source handling, especially the pixel EXEC check? Refs #16.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:34:08 +00:00
github manually merged commit 45fb409289 into gh-pr/142/base 2026-11-26 06:34:11 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 04:18 UTC · original · reviewed

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-25 04:18 UTC · [original](https://github.com/brcly/TuxBox/pull/142#pullrequestreview-6051799292) · **reviewed** Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
This discussion has been locked. Commenting is limited to contributors.
No description provided.