You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
shader: a domain program reading a control point at an index computed from data is refused as "not affine", and a computed hull read leaves its patch when the relative patch is also data; fix branch ready #8051
Two related gaps in tessellation lowering's computed control-point reads (#4727, and the select/phi extension 9f429e65a):
Domain reads are refused. Onimusha: Way of the Sword (PPSA27836) picks one of its patch's three control points from data in the first scene: v_cmp results feed v_cndmask/v_add_co_ci to make an index of 0, 1 or 2, and v_lshl_add_u32 scales it by the 32-byte control-point stride before a buffer_load from the off-chip ring. Main refuses it:
shader stage 3: tessellation lowering: the tessellation ring or LDS address is not affine in the control point and relative patch at pc 0x354
Computed indices are accepted only for hull LDS reads. Also, the index is computed from data the domain program read from its own patch, and independentOfRelative follows that read's address into the relative patch index, so even a hull read would be refused for an index derived that way.
Hull reads point into another patch when the relative patch index is also data. A computed read keeps the program's own address, which contains relative * inputs * localStride. When the program also uses its relative patch index as data, every relative base is replaced by the grouped patch instead of 0, so that term stays and the read lands in another patch's slots. Nothing refuses it.
Off-chip EvaluationInput reads get the same dynamic term as hull LDS reads; it 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.
A value read from the patch's own ring or LDS no longer counts as depending on the relative patch index: the lowered read takes its patch implicitly.
When the relative patch index is used as data, computed reads (hull and domain) subtract their relative patch term before the bases are replaced. Programs that do not use it as data keep the program's own address, as 9f429e65a's tests require.
Checks:
New GPU case DomainComputedPoint in agc_driver_tessellation: a copy of DomainCode that reads control points 1 and 2 at cndmask(0, 1, FLT_MAX < x0) * 16 + base, which is always the static address at run time. It draws the same patches as DomainCode and passes on an RTX 3080 (617.42) and an AMD Radeon RDNA 2 iGPU (1002:164e, 32.0.21045.5002); on main it fails with the same "not affine" refusal.
New unit case in agc_tessellation_lowering: a hull read at a computed index in a program that also references its relative patch now gets address - patch * 96; without the subtraction it fails. 9f429e65a's cases pass unchanged.
With both fix branches merged on main 8c9161eac, all 806 agc tests on an RTX 3080 (617.42) and an AMD Radeon RDNA 2 iGPU (1002:164e, 32.0.21045.5002): 805 pass on each. The one failure on each (agc_driver_pass_input_hazard on the RTX 3080, agc_trimmed_import on the Radeon) fails the same way on unchanged main.
check_conventions.py passes.
Not verified: the console's result for an index past the patch (the debt entry records the clamp).
I checked the ready branch 8262969c against current main. The implementation diff is clean, but git diff --check upstream/main...<branch> reports trailing whitespace on the newly added lines 105–208 of core/libs/prx/libSceAgcDriver/tests/TessellationLowering.cpp; those lines appear to have CRLF endings. Normalizing that added block to LF should clear the whitespace warnings. No other concern from this check.
Activity
MarcZX10 commentedon Oct 19, 2026
I checked the ready branch
8262969cagainst currentmain. The implementation diff is clean, butgit diff --check upstream/main...<branch>reports trailing whitespace on the newly added lines 105–208 ofcore/libs/prx/libSceAgcDriver/tests/TessellationLowering.cpp; those lines appear to have CRLF endings. Normalizing that added block to LF should clear the whitespace warnings. No other concern from this check.