Repository navigation
shader: name gfx10 register codes in gfx1013_graphics_wqm.inl - #3901
Merged
Merged
Conversation
Replace the magic register numbers in src/gfx1013_graphics_wqm.inl with the constants from src/gfx1013_registers.h: EXEC (126/127), VCC (106/107), the last general SGPR (105), the VGPR operand base (256) and the internal SCC slot written by the numeric WQM lowering (128). The substitution is textual and the values are unchanged, so the translator output is byte-identical. The aligned-pair bound 104, the 512 offset of the saved-coverage tags, export target masks, branch opcodes and IR text are left as they are. The file is already a native shader revision input and is compiled inside gfx1013_compute_native.cpp, which includes the header, so no build change is needed.
R0Y00
approved these changes
Dec 2, 2026
R0Y00
left a comment
Owner
There was a problem hiding this comment.
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.
This was referenced Dec 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
src/gfx1013_graphics_wqm.inlstill 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 addedsrc/gfx1013_registers.hto keep the register code, operand and translator slot meanings apart, and convertedgfx1013_compute_native.cpp.Change
This is the second slice. No behaviour change.
8b70c6773uses the constants fromgfx1013_registers.hinsrc/gfx1013_graphics_wqm.inl(+53/-37, one file). The substitution is textual and the values and types are unchanged.write(128)becomesreg::scc_slot: it is the SCC slot of the scalar state, not operand 128 (the constant 0).104, the bound for an aligned 64-bit register pair. The header has no constant for it, and shader: name gfx10 register codes in gfx1013_compute_native.cpp #3830 left it as is too.512 +, the key offset of the saved-coverage tags ingraphics_registers. It is a translator map key, not a register code or an operand, andgfx1013_direct_graphics.inluses the same offset.0x1890, an export target mask, along with branch opcodes and IR text. None of them are register codes.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
8b70c6773onmainc42b7ce3f.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_dxilandnative_translator_corpus_irpass.tests/translator_corpus_hash.py): the TSV built frommainc42b7ce3fand 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.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.