shader: use named register codes in gfx1013_vertex_id.cpp #3912
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3912
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3910"
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?
@Leyukaka on GitHub · 2026-12-03 05:00 UTC · original
Leyukaka:quality-item2-s4-vertex-id→main· +16 −12 · 1 files · 1 commits · merged 2026-12-03 05:13 UTCProblem
src/gfx1013_vertex_id.cppstill writes operands as bare numbers: 128, 192, 193 and 208 for the inline integer bounds, 128 for the constant 0 source of a scalar move, 255 for the literal and 256 for the first VGPR operand. #3832 addedsrc/gfx1013_registers.hto keep the register code, operand and translator slot meanings apart. #3903 and #3907 convertedgfx1013_graphics_wqm.inlandgfx1013_sampled_pixel.cpp.Change
This is the fourth slice. No behaviour change.
2e895d17duses the constants fromgfx1013_registers.hinsrc/gfx1013_vertex_id.cpp(+16/-12, one file). The substitution is textual and the values and types are unchanged, so the emitted HLSL and the refusal text are unchanged.namespace x2w, so it includes the header and addsnamespace gfx1013 = x2w::gfx1013;inside its anonymous namespace. The uses then readgfx1013::operand::....vgpr_basefor 256 as the first VGPR operand,zero/int_pos_lastfor the range 128..192,int_neg_first/int_neg_lastfor 193..208,literalfor 255, andzerofor thesrc == 128source of a scalar move.reg != 128in the disabled export check.gfx1013_vertex_id_disabled_export_mutuses that exact line as itsstring(REPLACE ...)source intests/cmake/gfx1013_vertex_id.cmake, so renaming it would make the configure step fail on the lost anchor. It can follow together with the anchor in a later change.240..247and its table indexselector - 240. The header'sfloat_lastis 248 (1/(2*pi)), which this translator refuses (refuse_unsupported_input_selector_248), so naming only the lower bound would leave the range half-converted.192u - selector, decode masks, opcodes and HLSL text.tests/cmake/gfx1013_vertex_id.cmaketarget lines this change does not touch.gfx1013_registers.his header-only and already insrc.Validation
Built on Windows with MSVC, head
2e895d17donmain7db6f1973. The targeted set passed:gfx1013_vertex_id_alland thegfx1013_vertex_id_*cases, which pin the generated HLSL and the refusal reasons.*_mut,WILL_FAIL) still fail as expected, so the anchors still apply.native_buffered_vertex_warp,native_sampled_pixel_warp,native_sampled_replayandnative_indexed_pixel_texture_warp.native_translator_corpus_dxilandnative_translator_corpus_ir.Translator corpus: the TSV built from
main7db6f1973and the TSV built from this branch have the same SHA-256, so they are byte-identical.Each replaced site was also read a second time against the header to confirm the same value, type and meaning.
Other open PRs
No open PR edits
gfx1013_vertex_id.cpp. Thegfx1013_direct_*.inlfrontends are still edited by many open PRs, so they will follow once that work lands.@R0Y00 on GitHub · 2026-12-03 05:10 UTC · original · approved these changes
Independently reviewed
2e895d17in a clean trial merge onto9dfe168a. The named operand constants match the original selectors and unsigned arithmetic at each changed site. Selector 248 still refuses, and the disabled-export mutation anchor stays intact. MSVC Debug passed 66 targeted cases: allgfx1013_vertex_id_*checks including the five WILL_FAIL controls, the DXIL and IR translator corpora, and the sampled replay and three WARP cases. The buffered-vertex readback matched 24/24 components; sampled replay matched both cold and warm outputs and its three refusal controls. Both regenerated corpus TSVs are byte-identical to the main build (DXIL SHA-2568c9a053ca0d0d4928654a46803675847099e013724ab2fe56159d7fbdb370ec5, IRc78e6c8b075bd114b360c87d9bbd0e2ce67a732f4ca62d25b0a7a3616cca9df6). No capability skips.