fix(agc): accept integer tessellation partitioning #5234
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5234"
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 AnthonyClemens on 2026-10-13T15:19:53Z.
What
Resident Evil 2, PPSA04288 (and presumably other RE engine titles) tessellates with integer partitioning, and right now any draw that does is thrown out. The state decoder stops with
only triangle and quad domains with fractional-odd partitioning and triangle output are supported by the reference path, and the hull and domain programs stop withShaderInputInfoBuilder: unsupported tessellation configuration.This lets
VGT_TF_PARAM.PARTITIONING= 0 through for triangle and quad patches and draws it with Vulkan's equal spacing.Where the mapping comes from:
PARTITIONINGis bits 2-4 ofVGT_TF_PARAMand 0 isPART_INTEGERin Mesa'sgfx10.json, and radeonsi writesPART_INTEGERforTESS_SPACING_EQUALinsi_state_shaders.cpp. I have not measured anything on a console.What changed:
SpacingEqualinstead ofSpacingFractionalOdd, and the pipeline's module check expects the same.Fractional-odd draws go through the same code as before. Partitioning was already in the shader cache key, the request serializer and the draw and pipeline keys, so none of that needed touching.
Power-of-two (1) and fractional-even (3) still throw. Vulkan has no power-of-two mode, and fractional-even needs a different clamp range, so I left it for its own PR. I added a line to
docs/dev/debt/shader.mdsaying the console's rounding of a clamped factor is unmeasured.Tested
Windows 11, MinGW-w64 GCC 15.2.0, Radeon RX 9070 XT.
agc_driver_tessellationandagc_driver_graphicsboth fail if I revert the source change and pass with it. The new checks cover: integer triangle patches decode, compile toSpacingEqualwith a bound of 64, and draw; fractional-odd still compiles toSpacingFractionalOddwith a bound of 63; power-of-two is still refused.ctest: 1082 of 1083 pass, 8 expected skips. The one failure isagc_driver_layered_volume_vertex_no_gpl(slice 1 texel (0, 0) channel 0 is 64, expected 255). It fails the same way on this card without my change.VGT_TF_PARAM=0x40042, quad domain, integer): the partitioning refusal is gone. It then stops a bit later in the hull lowering withthe hull shader reads no LDS per control point, so the local stride is unknown, which is a separate problem this PR doesn't touch. So I don't have a screenshot of an integer-tessellated patch from a real game, only the test's draw.I only have this one title to test with.
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 github-actions[bot] on 2026-10-13T15:29:39Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/tests/Graphics.cppL768-769core/libs/prx/libSceAgcDriver/tests/execution/Tessellation.cppL420docs/dev/debt/shader.mdL90core/libs/prx/libSceAgcDriver/tests/Graphics.cppL768-769core/libs/prx/libSceAgcDriver/tests/execution/Tessellation.cppL5, L420docs/dev/debt/shader.mdL90core/libs/prx/libSceAgcDriver/tests/Graphics.cppL768-769core/libs/prx/libSceAgcDriver/tests/execution/Tessellation.cppL5, L420docs/dev/debt/shader.mdL90Imported from boykopovar/AnyPS5. Originally posted by AnthonyClemens on 2026-10-13T15:37:59Z.
Note: The overlap with #4201 and #4222 is only in tests and docs: we each add a test in Tessellation.cpp, a line in shader.md, and touch neighboring lines in Graphics.cpp. None of the source files overlap and this doesn't build on them. Not depended on.
Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-13T18:47:28Z.
Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with
d7818c9e5merged into main9d0a41d5a:agc_driver_graphics,agc_driver_tessellation,agc_sparse_buffer_holes,agc_descriptor_pool_reset_failure,agc_compute_descriptor_layout_flags,agc_driver_covered_centroid_state).agc_driver_graphicsandagc_driver_tessellationfail; the other four pass.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-13T19:37:07Z.
Resident Evil Village (PPSA01556, 01.210.000), another RE Engine title, needs this too. It draws quad patches with integer partitioning (
VGT_TF_PARAM0x40042: quads of one control point, integer, CW, max level 15), and onmainthey stop with:I had the same change locally, line for line in the production files, so I won't open mine. I replayed 21 tessellation requests dumped from Village with
agc_shader_control_flow_tests, built on #4222's head (3a72fa3fa). Without integer partitioning, 5 compile and 15 stop atShaderInputInfoBuilder: unsupported tessellation configuration. With it, 15 compile. The rest need other hull changes. That was on Windows 11 with WinLibs GCC 15.2.0.