shader: name gfx10 register codes in gfx1013_graphics_wqm.inl #3901

Merged
Leyukaka merged 1 commit from upstream-pr/3901 into main 2026-12-02 23:51:38 +00:00
Leyukaka commented 2026-12-02 23:38:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-02T23:38:13Z.


Problem

src/gfx1013_graphics_wqm.inl still writes scalar registers as bare numbers: 126/127 for EXEC, 106/107 for VCC, 105 for the last general SGPR, 256 for the first VGPR operand and 128 for the SCC slot of the scalar state. #3830 added src/gfx1013_registers.h to keep the register code, operand and translator slot meanings apart, and converted gfx1013_compute_native.cpp.

Change

This is the second slice. No behaviour change.

  • 8b70c6773 uses the constants from gfx1013_registers.h in src/gfx1013_graphics_wqm.inl (+53/-37, one file). The substitution is textual and the values and types are unchanged.
  • The numeric WQM lowering's write(128) becomes reg::scc_slot: it is the SCC slot of the scalar state, not operand 128 (the constant 0).
  • Left numeric:
    • 104, the bound for an aligned 64-bit register pair. The header has no constant for it, and #3830 left it as is too.
    • 512 +, the key offset of the saved-coverage tags in graphics_registers. It is a translator map key, not a register code or an operand, and gfx1013_direct_graphics.inl uses the same offset.
    • 0x1890, an export target mask, along with branch opcodes and IR text. None of them are register codes.
  • No build change. The file is compiled inside gfx1013_compute_native.cpp, which already includes the header, and it is already a native shader revision input.

Validation

Built on Windows with MSVC, head 8b70c6773 on main c42b7ce3f.

  • native_graphics_wqm_ir, native_pixel_alpha_kill_controls, native_pixel_cmpx_discard_warp, native_pixel_compare_mask_ir, native_pixel_saveexec_masks_controls, native_pixel_cmpx_scalar_tail_controls, native_translator_corpus_dxil and native_translator_corpus_ir pass.
  • Translator corpus (tests/translator_corpus_hash.py): the TSV built from main c42b7ce3f and the TSV built from this branch have the same SHA-256, so they are byte-identical. The corpus is a general regression check; the WQM paths are covered by the targeted tests above.
  • Each replaced site was also read a second time against the header to confirm the same value and type.

Other open PRs

#3847 (draft) also edits gfx1013_graphics_wqm.inl, but only adds a block at the head of the file, above the lines changed here, so there is no overlap. If this lands first and a rebase is needed, I am glad to help.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5616706498 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3901). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-12-02T23:38:13Z. --- ## Problem `src/gfx1013_graphics_wqm.inl` still writes scalar registers as bare numbers: 126/127 for EXEC, 106/107 for VCC, 105 for the last general SGPR, 256 for the first VGPR operand and 128 for the SCC slot of the scalar state. #3830 added `src/gfx1013_registers.h` to keep the register code, operand and translator slot meanings apart, and converted `gfx1013_compute_native.cpp`. ## Change This is the second slice. No behaviour change. - `8b70c6773` uses the constants from `gfx1013_registers.h` in `src/gfx1013_graphics_wqm.inl` (+53/-37, one file). The substitution is textual and the values and types are unchanged. - The numeric WQM lowering's `write(128)` becomes `reg::scc_slot`: it is the SCC slot of the scalar state, not operand 128 (the constant 0). - Left numeric: - `104`, the bound for an aligned 64-bit register pair. The header has no constant for it, and #3830 left it as is too. - `512 +`, the key offset of the saved-coverage tags in `graphics_registers`. It is a translator map key, not a register code or an operand, and `gfx1013_direct_graphics.inl` uses the same offset. - `0x1890`, an export target mask, along with branch opcodes and IR text. None of them are register codes. - No build change. The file is compiled inside `gfx1013_compute_native.cpp`, which already includes the header, and it is already a native shader revision input. ## Validation Built on Windows with MSVC, head `8b70c6773` on `main` `c42b7ce3f`. - `native_graphics_wqm_ir`, `native_pixel_alpha_kill_controls`, `native_pixel_cmpx_discard_warp`, `native_pixel_compare_mask_ir`, `native_pixel_saveexec_masks_controls`, `native_pixel_cmpx_scalar_tail_controls`, `native_translator_corpus_dxil` and `native_translator_corpus_ir` pass. - Translator corpus (`tests/translator_corpus_hash.py`): the TSV built from `main` `c42b7ce3f` and the TSV built from this branch have the same SHA-256, so they are byte-identical. The corpus is a general regression check; the WQM paths are covered by the targeted tests above. - Each replaced site was also read a second time against the header to confirm the same value and type. ## Other open PRs #3847 (draft) also edits `gfx1013_graphics_wqm.inl`, but only adds a block at the head of the file, above the lines changed here, so there is no overlap. If this lands first and a rebase is needed, I am glad to help.
R0Y00 commented 2026-12-02 23:50:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T23:50:46Z.

Review: APPROVED


Reviewed 8b70c677. I checked all seven referenced register constants against gfx1013_registers.h. Substituting their original numeric spellings leaves the same WQM source after whitespace normalization, including the original wave64 alignment bound. The trial merge with main 1c4601ff is clean. At this head the Windows, Linux Python and gfx1013 fixture checks are green.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6161162811 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3901#pullrequestreview-6161162811). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T23:50:46Z. **Review:** APPROVED --- Reviewed `8b70c677`. I checked all seven referenced register constants against `gfx1013_registers.h`. Substituting their original numeric spellings leaves the same WQM source after whitespace normalization, including the original wave64 alignment bound. The trial merge with `main` `1c4601ff` is clean. At this head the Windows, Linux Python and gfx1013 fixture checks are green.
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!3901
No description provided.