shader: name gfx10 register codes in gfx1013_compute_native.cpp #3830
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3830"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-02T07:34:42Z.
Problem
The gfx1013 translator writes scalar registers and operands as bare numbers (106, 107, 124 to 128, 255, 256...). The same integer means different things depending on where it appears:
Change
This is the first slice of replacing those numbers with named constants that keep the three meanings apart. No behaviour change.
88541bca6addssrc/gfx1013_registers.hwithx2w::gfx1013::regandx2w::gfx1013::operand, and thegfx1013_registers_checktest.static_asserts pin every value and one case per predicate checks its boundaries.a65c80947uses the constants insrc/gfx1013_compute_native.cpp. The substitution is textual and the values are unchanged. Decode masks (& 127,& 255), HLSL text, VGPR counts and the remaining bounds (108,104,< 105,< 127,192u - code) are left as they are. The header joins the native shader revision inputs inCMakeLists.txt.Only
gfx1013_compute_native.cppis converted here. Many open PRs edit thegfx1013_direct_graphics.inl,gfx1013_direct_compute.inlandgfx1013_direct_mesh.inlfrontends, so those will follow in small slices once that work lands.Validation
Built on Windows with MSVC, head
a65c80947onmainf365f125b.gfx1013_registers_check,native_compile_dxil_refusals,gfx1013_compute_ir_all,native_fixed_graphics_psi1andnative_direct_containerpass.tests/translator_corpus_hash.py, steps indocs/experiments/translator-corpus.md): the output built frommainf365f125band the output built from this branch have the same SHA-256, so the DXIL fingerprints and the refusal reasons are byte-identical.Other open PRs
Several open PRs also edit
gfx1013_compute_native.cpp. Since this is a mechanical rename, any conflict with them is textual only. If this lands first and an author would like help with the rebase, I am glad to do it.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T18:45:13Z.
Review: APPROVED
Reviewed
a65c8094. I checked the numeric substitutions in the decoder, dataflow and emitter and verified that the SGPR, operand and VGPR constants retain their numeric values. Independent Windows/MSVC Debugcmake --build --preset dev --target gfx1013_registers_check compile_dxilandctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^gfx1013_registers_|^native_direct_mesh$'passed 5/5. Trial merge into98f808d9was clean.