shader: keep mesh output rows with an integer element constant #3825

Merged
lukaslw-lab merged 1 commit from upstream-pr/3825 into main 2026-12-02 08:57:40 +00:00
lukaslw-lab commented 2026-12-02 06:12:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-12-02T06:12:39Z.


Change

Fixes #3824. In a direct mesh or vertex output signature, an element whose row also holds an integer element is now emitted with constant interpolation (generic() in src/gfx1013_direct_graphics.inl). Before, a float in such a row was linear, so DXIL validation rejected the row. Rows holding only floats are unchanged.

Verification

Commit 50a90fd5 on main f365f125. Windows 10 19045, RTX 3080 Ti (driver 32.0.16.1047), in-box D3D12 runtime, DXC 1.9.2609, release preset.

Check Result
ctest --test-dir out/build/release -R '^native_direct_mesh$' passed
Same, with the source change reverted (negative control) fails: signature element TEXCOORD at location (1,1) ... has interpolation mode that differs from another element packed into the same row.
ctest --test-dir out/build/release -R '^native_|mesh|ngg|graphics' -j4 (678 tests, on main e958b8e8) 327 passed, 266 skipped, 85 failed. All 85 were rerun on plain main f365f125: 82 fail the same way (GPU tests on this host's in-box Win10 D3D12 runtime, e.g. CreatePipelineState 0x80070057). The 2 native_indexed_pixel_texture_* tests skip on both after #3823. native_translator_corpus_ir is flaky on plain main too (3 of 8 runs passed, 2 of 8 on this branch; incomplete or conflicting outputs on a compute key).
Local slot 86 census, 6,685 distinct mesh programs (main 0dd65da1) the 3 Validation failed. programs now compile (1,036 → 1,039 OK); no other program changes outcome
  • New cases in tests/native_direct_mesh_check.py, built on the existing source-built container fixture:
    • integer-row: u32 COLOR.x and f32 TEXCOORD.y in one row; TEXCOORD becomes constant;
    • float-row: two floats in one row; TEXCOORD stays linear.
  • A program that validated before cannot hold an integer and a float in one output row, so already translated programs keep the same signature.

Evidence and follow-up

  • The guest pixel stage paired with the 3 programs reads both channels of the packed attribute with v_interp_mov_f32.
  • AI-assisted (Claude Code).

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed (none changed).
  • I did not include game files, dumps, distribution links or secrets.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5600962492 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3825). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-12-02T06:12:39Z. --- ## Change Fixes #3824. In a direct mesh or vertex output signature, an element whose row also holds an integer element is now emitted with constant interpolation (`generic()` in `src/gfx1013_direct_graphics.inl`). Before, a float in such a row was linear, so DXIL validation rejected the row. Rows holding only floats are unchanged. ## Verification Commit `50a90fd5` on main `f365f125`. Windows 10 19045, RTX 3080 Ti (driver 32.0.16.1047), in-box D3D12 runtime, DXC 1.9.2609, release preset. | Check | Result | |---|---| | `ctest --test-dir out/build/release -R '^native_direct_mesh$'` | passed | | Same, with the source change reverted (negative control) | fails: `signature element TEXCOORD at location (1,1) ... has interpolation mode that differs from another element packed into the same row.` | | `ctest --test-dir out/build/release -R '^native_\|mesh\|ngg\|graphics' -j4` (678 tests, on main `e958b8e8`) | 327 passed, 266 skipped, 85 failed. All 85 were rerun on plain main `f365f125`: 82 fail the same way (GPU tests on this host's in-box Win10 D3D12 runtime, e.g. `CreatePipelineState 0x80070057`). The 2 `native_indexed_pixel_texture_*` tests skip on both after #3823. `native_translator_corpus_ir` is flaky on plain main too (3 of 8 runs passed, 2 of 8 on this branch; `incomplete or conflicting outputs` on a compute key). | | Local slot 86 census, 6,685 distinct mesh programs (main `0dd65da1`) | the 3 `Validation failed.` programs now compile (1,036 → 1,039 OK); no other program changes outcome | - New cases in `tests/native_direct_mesh_check.py`, built on the existing source-built container fixture: - `integer-row`: u32 `COLOR.x` and f32 `TEXCOORD.y` in one row; `TEXCOORD` becomes constant; - `float-row`: two floats in one row; `TEXCOORD` stays linear. - A program that validated before cannot hold an integer and a float in one output row, so already translated programs keep the same signature. ## Evidence and follow-up - The guest pixel stage paired with the 3 programs reads both channels of the packed attribute with `v_interp_mov_f32`. - AI-assisted (Claude Code). ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed (none changed). - [x] I did not include game files, dumps, distribution links or secrets. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Leyukaka commented 2026-12-02 07:02:33 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-02T07:02:33Z.

Review: APPROVED


Review of 50a90fd5. Read the diff; not built or run.

The change is limited to output rows in generic() (src/gfx1013_direct_graphics.inl:198-203). An output element now gets constant interpolation when its row also holds a non-system element that is not a float (component != 3). Before, only the integer element itself was constant. A float packed beside it stayed linear, and DXIL validation rejected the row. What I checked:

  • Inputs are unchanged (!input), so pixel-stage interpolation is not affected.
  • Float-only rows keep the caller's mode, and an integer element was already constant. A program that validated before cannot have an integer and a float in the same row, so programs that already translated keep the same signature.
  • System elements are excluded on both sides: the loop skips s.system, and the predicate checks !o.system. This matches the scope of generic().
  • The two new cases, integer-row and float-row, check the interpolation field of TEXCOORD in the dumped signature (constant 1, linear 2). The description reports the failure with the source change reverted.

No changes requested. Approving 50a90fd5.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6146134256 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3825#pullrequestreview-6146134256). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-12-02T07:02:33Z. **Review:** APPROVED --- Review of `50a90fd5`. Read the diff; not built or run. The change is limited to output rows in `generic()` (`src/gfx1013_direct_graphics.inl:198-203`). An output element now gets constant interpolation when its row also holds a non-system element that is not a float (`component != 3`). Before, only the integer element itself was constant. A float packed beside it stayed linear, and DXIL validation rejected the row. What I checked: - Inputs are unchanged (`!input`), so pixel-stage interpolation is not affected. - Float-only rows keep the caller's mode, and an integer element was already constant. A program that validated before cannot have an integer and a float in the same row, so programs that already translated keep the same signature. - System elements are excluded on both sides: the loop skips `s.system`, and the predicate checks `!o.system`. This matches the scope of `generic()`. - The two new cases, `integer-row` and `float-row`, check the interpolation field of `TEXCOORD` in the dumped signature (constant 1, linear 2). The description reports the failure with the source change reverted. No changes requested. Approving `50a90fd5`.
R0Y00 commented 2026-12-02 08:56:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T08:56:58Z.

Review: APPROVED


Independently built compile_dxil in Windows Debug at 50a90fd5 and ran ctest --preset dev --no-tests=error -j 1 -R '^native_direct_(mesh|container)$' --output-on-failure. Both tests passed, including the mixed integer/float row and the all-float control. The change is confined to output signatures and preserves the interpolation mode of all-float rows.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6147524356 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3825#pullrequestreview-6147524356). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T08:56:58Z. **Review:** APPROVED --- Independently built `compile_dxil` in Windows Debug at `50a90fd5` and ran `ctest --preset dev --no-tests=error -j 1 -R '^native_direct_(mesh|container)$' --output-on-failure`. Both tests passed, including the mixed integer/float row and the all-float control. The change is confined to output signatures and preserves the interpolation mode of all-float rows.
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
R0Y00/Xbox2Windows!3825
No description provided.