Repository navigation
feat(shader): read domain inputs at a control-point index computed from data - #8144
Conversation
…om data A domain program that picks one of its patch's control points from data (Onimusha: Way of the Sword, PPSA27836, selects a corner with v_cmp and v_cndmask before a buffer_load from the off-chip ring) was refused with "the tessellation ring or LDS address is not affine in the control point and relative patch". Computed indices were accepted only for hull LDS reads. - The address evaluator gives off-chip EvaluationInput reads the same dynamic term as hull LDS reads, and a value read from the patch's own ring or LDS no longer counts as depending on the relative patch index, since the lowered read takes the patch implicitly. - When the program also uses its relative patch index as data, the index is replaced by the grouped patch instead of 0, which left a computed read's address pointing into another patch. Such reads now subtract their relative patch term, for hull and domain reads alike; reads in programs that do not use the index as data keep their address. - The computed offset must be a whole number of control points, and the backend clamps the domain gl_in index to the last output control point as it already does for hull reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Results on current
Not run: the validation layer and a title. AI-assisted: yes (Claude Code); results above were run on this machine. |
|
First Linux run of this PR, on AMD with RADV. Head AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release. Full suite ( Comparing the JUnit output with GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38 AI-assisted: yes |
What
Tessellation lowering accepted a computed control-point index only for hull LDS reads (#4727, extended to selects and phis by
9f429e65a). Two gaps, reported in #8051:v_cmpresults feedv_cndmask/v_add_co_ci, thenv_lshl_add_u32scales the index by the 32-byte stride before abuffer_loadfrom the off-chip ring), and main stops withtessellation lowering: the tessellation ring or LDS address is not affine in the control point and relative patch at pc 0x354.relative * inputs * localStride; when the program also uses its relative patch index as data, the bases are replaced by the grouped patch instead of 0, so that term stayed and the read landed in another patch's slots.Changes:
EvaluationInputreads get the same dynamic term as hull LDS reads. It must be a whole number of control points, and the backend clamps the domaingl_inindex to the last output control point, as it already does for hull reads (the hull input control points entry indocs/dev/debt/shader.mdnow covers both).9f429e65a's tests require.Tested
Windows 10 Pro 22H2 (19045), WinLibs GCC 15.2.0 r7, Release, on main
3aa35dc01.DomainComputedPointinagc_driver_tessellation: a copy ofDomainCodethat reads control points 1 and 2 atcndmask(0, 1, FLT_MAX < x0) * 16 + base, always the static address at run time; it draws the same patches asDomainCode. Without the change it fails with the "not affine" refusal.agc_tessellation_lowering: a hull read at a computed index in a program that also references its relative patch getsaddress - patch * 96; without the subtraction it fails.9f429e65a's cases pass unchanged.agc_driver_tessellation,agc_tessellation_loweringandagc_tessellation_factor_ringpass on both GPUs below. On an earlier base (8c9161eac, with fix(shader): preserve read lane dominance across branches #8089's change merged in) all 806agctests ran on both: 805 pass on each, and the one failure on each (agc_driver_pass_input_hazardon the RTX 3080,agc_trimmed_importon the Radeon) fails the same way on unchanged main.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pywas not run (noghon this host).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)1002:164e), 32.0.21045.5002, Windows 10 22H2🤖 Generated with Claude Code