fix(agc): accept fractional-even tessellation partitioning #5402
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5402"
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 boykopovar/AnyPS5. Originally posted by codingreapermaps on 2026-10-13T18:50:29Z.
What
Tessellation with
VGT_TF_PARAM.PARTITIONING3 (fractional-even) threwonly triangle and quad domains with integer or fractional-odd partitioning and triangle output are supported by the reference path. #5234 left this mode for its own PR; this is that PR.SpacingFractionalEven, which radeonsi programs asPART_FRAC_EVEN. The draw state, the shader input info, the SPIR-V emitter and the pipeline's module check all accept it.VGT_HOS_MAX_TESS_LEVELbelow 2 therefore still tessellates at 2; the console's order of that clamp and the minimum is not measured and is recorded indocs/dev/debt/shader.md.Tested
Windows 11, MinGW-w64 GCC 15.2.0, NVIDIA GeForce MX450 (driver 581.83) and lavapipe (Mesa 26.2.4, mesa-dist-win).
agc_driver_graphics_tests:VGT_TF_PARAM0x4004d decodes as partitioning 3 and is no longer refused; 0x40045 (power of two) still is.agc_driver_tessellation_tests: newRequireFractionalEvenPartitioningchecks that the domain module has fractional-even spacing and that the hull bounds factors at 64. Its domain program lowers each domain point by3·min(u, v, w), so edge points stay in place and only an interior point reaches below the patch. With integer spacing the level-1 patch covers nothing below its base and the level-5 patch does. With fractional-even spacing the level-1 patch does too (raised to level 2), the level-0 patch is culled and the level-5 patch has interior points. All tessellation tests pass on NVIDIA and lavapipe.mainat43349d433. The title ran on a local branch with this change and unrelated local changes (#4820 among them).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)Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-13T19:17:13Z.
Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with 6e527338b merged into main
18c438b10:agc_driver_graphicspasses (it fails on main), butagc_driver_tessellationfails at the new fractional-even case:AGC graphics: fractional-even partitioning: the level-1 patch was not raised to level 2 with a domain point at its centre, (255, 0, 0, 255)only triangle and quad domains with fractional-odd partitioning and triangle output are supported by the reference path.I can't tell from here whether this is specific to lavapipe's tessellator; the PR was tested on an NVIDIA MX450 under Windows.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T03:05:43Z.
coltken95's lavapipe run fails the new case:
the level-1 patch was not raised to level 2 with a domain point at its centre. CI runs these tests on lavapipe, so please find out whether the test or the clamp is wrong there.The branch also carries a copy of #5234's commit; once #5234 is in, please rebase so only yours is left.
Imported from boykopovar/AnyPS5. Originally posted by codingreapermaps on 2026-10-14T09:55:54Z.
The test was wrong, not the clamp. The test pixel shader reads the colour with
v_interp_mov_f32from P0, so every tessellated triangle is flat-shaded with its provoking vertex. The check at the centre therefore depended on which vertex the tessellator emits first, and that order is implementation-dependent. NVIDIA puts the centre point first in each of the six triangles around it, so the centre read 255. lavapipe puts an edge point first, so it read 0. Integer spacing with every factor at 2, which this PR does not touch, gives the same split: 255 on NVIDIA, 0 on lavapipe.The new test does not depend on the vertex order. Its domain program lowers each point by
3·min(u, v, w), so edge points stay in place and only an interior point reaches below the patch's base. With integer spacing, the level-1 patch covers nothing below its base. With fractional-even spacing, it does (raised to level 2). The level-5 patch covers that area in both modes. It passes on NVIDIA and on lavapipe (Mesa 26.2.4), which raises the level-1 factors to 2 like the D3D11 tessellator it is built on (TriProcessTessFactors).Rebased on
mainnow that #5234 is in; only this PR's commit is left.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T19:27:45Z.
Checked on a rebase onto current main (only
docs/dev/debt/shader.mdconflicted; I kept main's relative patch index line and this PR's lines): scoped build + ctest green;agc_driver_graphicsandagc_driver_tessellationalso pass on CI's lavapipe (Mesa 25.2.8). With the code changes reverted both tests fail, so they pin the change. The fractional-even test no longer depends on the tessellator's vertex order. Pushing the rebase; merging once CI is green.