xshader: allow spare SRC2 v_fmac_f32 against a mesh root address #440

Merged
s3rius merged 1 commit from upstream-pr/440 into main 2026-11-29 11:31:54 +00:00
s3rius commented 2026-11-29 04:29:15 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by s3rius on 2026-11-29T04:29:15Z.


Summary

The descriptor-dataflow check in the mesh emitter refused any instruction that used a mesh root address as shader data. Its allow-list covered descriptor construction, v_mbcnt_* with the spare SRC2, and VOP3 spare-SRC2 forms (v_cmp_*, v_mul_f32, v_and_b32, …), but not v_fmac_f32 — which is a two-input VOP3 with a spare SRC2 field that decodes as s0. Both concrete failing mesh pipelines (CascadeShadows 08caa2fb… and TransformD 5fe7aacac…) refused with mesh root address used as shader data at 0xb90 and 0x3f4 respectively, ~26 pipelines in one ProjectScarlett run. The fix adds v_fmac_f32 to the spare-SRC2 allow-list, exactly mirroring the accepted handling of other two-input VOP3s and keeping v_fma_f32 ineligible (it is a genuine three-input instruction). Verified by: offline translation of both real failing shaders (now exit 0, HLSL coherent), both shaders producing .cso in the new runtime cache, 572 compiler tests passing, including a new regression test that fails without the fix, and a full game run whose failure record no longer contains the mesh-root-address bucket. The driver-compile, wave-32-width, readlane-non-uniform-loop, and remaining s_load … root table pointer refusals are unchanged and out of scope.

Tested

Run the checks relevant to this change.

  • The checks relevant to this change passed
  • Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below
  • Where the table calls for AMD and NVIDIA, they passed on both. Otherwise, say which vendor still needs to run them:

GPU, driver and backend:

Commands run and their results:

tuxbox.py check


Summary
  passed   Build the shader compiler (0s)
  FAILED   Python tests (74s)  # Also fails on main, as I understand.
  passed   Shader compiler tests (0s)
  passed   DXBC tests (0s)
  passed   XG layout tests (8s)
  passed   Storage codec tests (0s)
  passed   D3D12 Windows typecheck (0s)
  passed   Build (27s)
  passed   Lanes and fixtures on the GPU (135s)
  passed   D3D12 regression controls (23s)
  passed   Shader translator on the GPU (81s)

Checks

CI runs the Python unit tests, the shader compiler, DXBC, and XG layout tests, and a Windows typecheck of tuxbox-d3d12.

If this pull request changes evidence JSON, regenerate the results table and the progress map and include both files:

python tuxbox.py status > docs/RESULTS.md
python tuxbox.py status --svg docs/progress.svg
<!-- greyfinch-sync:brcly/TuxBox:issue:5547548016 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/440). Originally posted by [s3rius](https://github.com/s3rius) on 2026-11-29T04:29:15Z. --- ## Summary The descriptor-dataflow check in the mesh emitter refused any instruction that used a mesh root address as shader data. Its allow-list covered descriptor construction, v_mbcnt_* with the spare SRC2, and VOP3 spare-SRC2 forms (v_cmp_*, v_mul_f32, v_and_b32, …), but not v_fmac_f32 — which is a two-input VOP3 with a spare SRC2 field that decodes as s0. Both concrete failing mesh pipelines (CascadeShadows 08caa2fb… and TransformD 5fe7aacac…) refused with mesh root address used as shader data at 0xb90 and 0x3f4 respectively, ~26 pipelines in one ProjectScarlett run. The fix adds v_fmac_f32 to the spare-SRC2 allow-list, exactly mirroring the accepted handling of other two-input VOP3s and keeping v_fma_f32 ineligible (it is a genuine three-input instruction). Verified by: offline translation of both real failing shaders (now exit 0, HLSL coherent), both shaders producing .cso in the new runtime cache, 572 compiler tests passing, including a new regression test that fails without the fix, and a full game run whose failure record no longer contains the mesh-root-address bucket. The driver-compile, wave-32-width, readlane-non-uniform-loop, and remaining s_load … root table pointer refusals are unchanged and out of scope. ## Tested Run the [checks relevant to this change](../CONTRIBUTING.md#test-what-your-change-touches). - [x] The checks relevant to this change passed - [x] Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below - [x] Where the table calls for AMD and NVIDIA, they passed on both. Otherwise, say which vendor still needs to run them: GPU, driver and backend: Commands run and their results: ```text tuxbox.py check Summary passed Build the shader compiler (0s) FAILED Python tests (74s) # Also fails on main, as I understand. passed Shader compiler tests (0s) passed DXBC tests (0s) passed XG layout tests (8s) passed Storage codec tests (0s) passed D3D12 Windows typecheck (0s) passed Build (27s) passed Lanes and fixtures on the GPU (135s) passed D3D12 regression controls (23s) passed Shader translator on the GPU (81s) ``` ## Checks CI runs the Python unit tests, the shader compiler, DXBC, and XG layout tests, and a Windows typecheck of `tuxbox-d3d12`. If this pull request changes evidence JSON, regenerate the results table and the progress map and include both files: ```sh python tuxbox.py status > docs/RESULTS.md python tuxbox.py status --svg docs/progress.svg ```
DrArroway commented 2026-11-29 08:07:59 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-29T08:07:59Z.


Verified head 1bce4028 on AMD RDNA 2 across both local adapters (Mesa RADV 26.3.1, GE-Proton11-14, Linux 7.3.6):

  • 1002:73bf (AMD Radeon RX 6900 XT): all 11 tuxbox.py check steps passed (114/114 Lanes & fixtures, 22/22 D3D12 regression controls, shader translator on GPU, all CPU/CI suites including Python tests).
  • 1002:164e (AMD Raphael Radeon 610M): all 11 tuxbox.py check steps passed (113/113 Lanes & fixtures, 22/22 D3D12 regression controls, shader translator on GPU, all CPU/CI suites including Python tests).
<!-- greyfinch-sync:brcly/TuxBox:comment:7252906855 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/440#issuecomment-7252906855). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-29T08:07:59Z. --- Verified head `1bce4028` on AMD RDNA 2 across both local adapters (Mesa RADV 26.3.1, GE-Proton11-14, Linux 7.3.6): - **`1002:73bf` (AMD Radeon RX 6900 XT):** all 11 `tuxbox.py check` steps passed (`114/114` Lanes & fixtures, `22/22` D3D12 regression controls, shader translator on GPU, all CPU/CI suites including Python tests). - **`1002:164e` (AMD Raphael Radeon 610M):** all 11 `tuxbox.py check` steps passed (`113/113` Lanes & fixtures, `22/22` D3D12 regression controls, shader translator on GPU, all CPU/CI suites including Python tests).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
brcly/TuxBox!440
No description provided.