fix(agc): refuse last-vertex strips only for reads of a vertex slot #5734
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5734"
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 YossiYad on 2026-10-14T08:31:01Z.
What
With
fragmentShaderBarycentric(RADV, NVIDIA) the translator writesv_interp_p1_f32andv_interp_p2_f32asP0 + I * P10 + J * P20overpervertexEXTvalues, so every smooth pixel input is a per-vertex input.ValidateProvokingVertexrefuses a triangle strip drawn withPROVOKING_VTX_LASTwhen any input is per-vertex, so with GL's last-vertex convention every interpolating shader on a strip threw:That order question only matters to a shader that reads a slot itself.
IandJare loaded fromgl_BaryCoordKHR[1]and[2](InstructionTranslator.cpp,component + 1inSpirvModuleEmitter.cpp), in the same vertex order as thepervertexEXTarray thatP0,P10andP20come from (vertex 0, vertex 1 minus vertex 0, vertex 2 minus vertex 0). So av_interp_p1/p2pair givesb0 * v0 + b1 * v1 + b2 * v2whichever order the device puts an odd strip triangle in.v_interp_mov_f32or 16-bit interpolation inpixelVertexOrderInputs.FragmentParametercarries that asvertexOrder(cache encoder and its size assertion updated), and the strip check refuses only those.v_interp_movread. The flat-input check is unchanged.Titles. Both are ps5-opengl (Mesa) titles, and the shaders dumped from ES-DE's run use only
v_interp_p1_f32/v_interp_p2_f32:main. With this PR: 5 of 5 runs of 40 s without a stop, menu and scroller drawn at 59.94 fps.Fixes #5245.
Tested
Linux (Bazzite 44, GCC 16.2.1, Ninja, Release,
-DBUILD_TESTING=ON), based onmain315260903:ctest: 1105 of 1106 pass.agc_driver_tessellationsegfaults on unchangedmainhere too.agc_driver_graphicsrecompiles a pixel shader that interpolates one input withv_interp_p1/p2(per-vertex, notvertexOrder, accepted on a last-vertex strip) and one that reads it throughv_interp_movP10 (vertexOrder, refused on a strip, accepted on a list). The first check fails with the strip guard onperVertex, and the second fails without thev_interp_movrecord.tools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.pyreports #5466 on the neighbouringstatic_assertline ofShaderDiskCache.cpp(CompiledShaderInfo); the two changes don't depend on each other, so whichever lands second keeps both values. Windows was not built here.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-14T10:34:21Z.
Windows run, adding a title this unblocks. Windows 11 Pro 25H2, RTX 3080 (NVIDIA 591.86), WinLibs GCC 15.2.0, Ninja Release. Head
5ea14b9a0merged ontomain23e93c054with no conflicts.agc_driver_graphicsandagc_shader_disk_cachepass 5 of 5. The build has 0 warnings.--windows, 60 s):mainit exits0xC0000409about 5 s after start-up withAGC graphics: last provoking vertex with explicit per-vertex triangle-strip interpolation is unsupported. That stop is new onmainsince 13 Oct.Forbidden syscall instruction), so I couldn't run it here.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-14T11:50:13Z.
Adding to babyhuey's run: the revert check and the rest of the homebrew catalog. Windows 11, RTX 4080 (NVIDIA 616.56), WinLibs GCC 15.2.0, Release, this head merged onto
main31bfc4e86.ctest: 1140 of 1140 pass (7 display-only skips). With onlyPipeline.cpptaken back tomainand the new tests kept,agc_driver_graphicsfails onlast provoking vertex with explicit per-vertex triangle-strip interpolation is unsupported, so the new strip case pins the change.--trap-sdk-syscall-stubs, originaleboot.bininapp0),mainagainst this PR with the same run settings: 65 titles end the same way (same stop line, or a full run with frames). Régie5 stops 17-19 s in onmainin 4 of 4 runs. With this PR it runs the full 45 s in 4 of 4 and draws its Home screen ("No configuration: see Settings"); it presents only when the screen changes. Ruffle (PPSA68091) ran 45 s once with this PR but crashed at 3 s in 3 more PR runs, as it does onmain. So that difference is its existing #4013 crash, not this change.--trap-sdk-syscall-stubs. It ran 45 s without the stop onmain(2 runs) and with this PR (1 run), so this machine doesn't show the intermittent stop.AI-assisted: yes (Claude Code Opus 5.5)
Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-14T21:19:51Z.
Rebased onto
main0ae1deb85(new heade4d0e2dc7). The only conflict was thestatic_assertblock inShaderDiskCache.cpp, where #5466 changedCompiledShaderInfoto 352 next to this PR'sFragmentParameter16; both are kept, and the PR's changed lines are the same as before. Full build andctesthere: 1181 of 1204 pass and 20 are skipped (display tests).agc_driver_tessellationandagc_host_import_sparsefail as onmain, andagc_driver_pixel_interlockfailed once under-j8and passed 3 of 3 alone.agc_driver_graphicsandagc_shader_disk_cachepass.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:09:00Z.
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.
core/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/shader/recompiler/Recompiler.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/shader/recompiler/Recompiler.hppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/Recompiler.hppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/Recompiler.hppdocs/dev/debt/libSceAgcDriver.mdcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppdocs/dev/debt/libSceAgcDriver.mdcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppdocs/dev/debt/libSceAgcDriver.mdcore/shader/recompiler/Recompiler.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/Recompiler.hppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/shader/recompiler/Recompiler.hppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ProgramMetadata.hppcore/shader/recompiler/Recompiler.hppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/shader/recompiler/Recompiler.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppdocs/dev/debt/libSceAgcDriver.mdImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T12:28:08Z.
Checked on Linux with the PR merged onto current
main:agc_driver_graphicspasses, and the new strip cases pin the change (confirmed by @orishamir's revert ofPipeline.cppon Windows). Thev_interp_p1/p2argument holds:I/Jand thepervertexEXTvalues share one vertex order, soP0 + I*P10 + J*P20is order-independent. Slot reads (v_interp_mov, 16-bit) stay refused, the debt entry matches, and the cache encoder/size assertion are updated.agc_driver_tessellationfails onmaintoo. Third-party Windows runs by @babyhuey and @orishamir cover what Linux can't; merging.