feat(shader): emulate barycentrics and per-vertex parameters on the mesh path #6941
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6941"
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 kq62 on 2026-10-16T20:33:50Z.
What
Fixes #5079. On a device without
VK_KHR_fragment_shader_barycentric, a pixel shader that reads barycentrics after an NGG program on the mesh path stopped inDraw.cpp("needs a vertex shader before it"): the vertex-path emulation inserts a generated geometry stage, which a mesh pipeline cannot have. This blocks ccleste (PPSA59322) on Intel Arc on Windows, and #5079 reports the same stop in about a dozen catalog homebrew on other devices.MeshBarycentricLayout, taken from the pixel compile result). It writes its clip position as a varying and the three corner clip positions of each primitive as per-primitive outputs. The pixel shader solves a 3x3 system for the weights, for smooth and linear interpolation.v_interp_movP10/P20) are staged in workgroup memory and written per primitive, in the order of the triangle indices.DescribeEmulatedInterface, split out of #7308'sCollectEmulatedInterface, so the geometry, tessellation and mesh routes share one description of it. The mesh path is handled first inDraw.cpp; the vertex path falls through to the geometry and tessellation builders.FormatVersion38) and the captured request (serializer 33).ShaderValidationaccepts a per-primitive interface only at the locations the layout reserves, and only for mesh outputs and pixel inputs; guest per-primitive user outputs still throw.agc_mesh_output_budget.Not measured on PS5: the weights match the analytic values within the existing test tolerance, not hardware I/J bit for bit, and the vertex order of per-vertex parameters follows the triangle indices with the first provoking vertex.
lavapipe exposes
VK_EXT_mesh_shader, but1d6968225records that mesh pipeline draws die with an LLVM error on Mesa 25.2.8 / LLVM 20.1.2. The new test skips on llvmpipe like the existing mesh test, and lavapipe titles may move from the clean error to that crash. There is no llvmpipe-specific handling.Related: #7308 adds the tessellation route for the vertex path on devices without geometry shaders and shares the interface helper with this PR. #6523 adds a general mesh-shader check in
ValidateShaders, which complements the barycentric-specific message here. #6612 touches the same files and versions, so whichever lands second rebases. #6470 is nearby.Tested
MeshBarycentricEmulationexecution test: 932 perspective, 932 linear and 932 per-vertex pixels match, in under 1 s. It fails without this change. Newagc_mesh_output_budgetchecks the output estimate against hand-computed values (ccleste's configuration: 8 + 10 locations, 36864 bytes), in 0.06 s.ShaderDiskCache.cppwere checked with GCC 13.3 at the first and last commit.BUILD_TESTING=ONon24bb8b0c0(rebased on66e71b63d, after #7308): 1475 of 1478 pass.windows_import_modulesandagc_driver_host_import_lifetimealso fail on cleanmain;guest_usbdfailed once and passed on rerun.agc_driver_gpu_indirect_arguments_misaligned_writer_aheadis not built with MinGW GCC (#6716).mainit stops on the barycentric check; with this PR it renders the first level (screenshot below) at about 78 FPS and runs without errors. That run used a warm pipeline cache; the cold-run watchdog in #5079 is a separate measurement.main. On an Intel Arrow Lake iGPU (Mesa 26.1.6 ANV, mesh shaders without the barycentric extension), 5 of the 11 get past the stop and 4 are refused by the mesh output memory check (34304 > 32768 bytes with the earlier estimate; 36864 with the spec-based one); see the comments.agc_driver_mesh_barycentric_emulation,agc_mesh_output_budget,agc_shader_disk_cache,agc_shader_memoryandrequest_serializerpass.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)ccleste (PPSA59322) on the Intel Arc 140T with this PR:
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-16T20:38:14Z.
On Linux this head (b7cc86198, merged onto
main1b1f8483c, Ubuntu 24.04, GCC 13.3, Release) doesn't build. Two of the libstdc++-only size checks inShaderDiskCache.cppfail:The new
std::optional<MeshBarycentricLayout> meshBarycentricsadds the 40 bytes.encodeArtifact/decodeArtifactalready write and read it, andEncodeResultgoes throughencodeArtifact, so only the two expected sizes need updating (280 and 512). These checks only exist under__linux__ && __x86_64__ && __GLIBCXX__, which is probably why your build passed. I'll run the before/after lists with those two numbers changed locally and post the results here.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T20:44:01Z.
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/CMakeLists.txtL2022core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppL473-474core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cppL26-27core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppL345, L621-622, L658-659core/shader/recompiler/CacheKey.hppL104-105, L109core/shader/recompiler/tests/RequestSerializerTests.cppL210, L249, L274, L397-400, L411, L431, L433core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppL53core/shader/recompiler/tests/RequestSerializerTests.cppL210, L249, L274, L398, L411, L431, L433core/shader/recompiler/tests/RequestSerializerTests.cppL210, L249, L274, L397-400, L411, L431, L433core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppL53core/shader/recompiler/Recompiler.cppL593core/shader/recompiler/tests/RequestSerializerTests.cppL210, L249, L274, L398, L411, L431, L433core/libs/prx/libSceAgcDriver/CMakeLists.txtL2022core/shader/recompiler/Recompiler.hppL477-492, L496core/shader/recompiler/ShaderDiskCache.cppL506, L553core/shader/recompiler/SpirvBackend/src/BarycentricGeometryShader.cppL398core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppL221core/shader/recompiler/Recompiler.cppL573core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hppL31core/shader/recompiler/tests/RequestSerializerTests.cppL210, L249, L274, L398, L411, L431, L433core/shader/recompiler/CMakeLists.txtL238core/shader/recompiler/tests/RequestSerializerTests.cppL210, L249, L274, L398, L411, L431, L433Some 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/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/shader/recompiler/CMakeLists.txtcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/shader/recompiler/tests/RequestSerializerTests.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cppcore/shader/recompiler/Recompiler.hppcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/shader/recompiler/tests/RequestSerializerTests.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/shader/recompiler/tests/RequestSerializerTests.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/shader/recompiler/CMakeLists.txtcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/CMakeLists.txtcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/CMakeLists.txtcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cppcore/shader/recompiler/CMakeLists.txtcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/CMakeLists.txtcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/ControlFlow/src/RequestSerializer.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/BarycentricGeometryShader.cppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppcore/shader/recompiler/tests/RequestSerializerTests.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/CMakeLists.txtcore/shader/recompiler/CacheKey.hppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitter.hppcore/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hppcore/shader/recompiler/SpirvBackend/src/SpirvEmitter.cppcore/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvEmitterHelpers.cppcore/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdImported from boykopovar/AnyPS5. Originally posted by kq62 on 2026-10-16T20:44:57Z.
Thanks, good catch. Both values are fixed (280 and 512) and folded into the first commit, so each commit has them. I syntax-checked
ShaderDiskCache.cppon Linux with GCC 13.3 at the first and the last commit, and both asserts hold; I haven't done a full Linux build. Those checks are behind__linux__ && __x86_64__ && __GLIBCXX__, so my MinGW build never compiled them. The new head is042bb42. Looking forward to the before/after runs.Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-16T20:48:24Z.
Before/after on the Intel VM from my #5079 list: Arrow Lake iGPU, Mesa 26.1.6 ANV, Debian.
main1b1f8483cvs thatmain+ this head b7cc86198, with the two Linux size checks set to 280/512 locally. Release build, 40 s with pad input, one run each.That device does expose
VK_EXT_mesh_shader; my note on #5079 was wrong. It has noVK_KHR_fragment_shader_barycentric, andmaxMeshOutputMemorySizeis 32768. So it is the combination this PR targets.mainbarycentric emulation on the mesh path needs 34304 bytes of mesh output memory, the device allows 32768, 3 sa pixel shader that reads barycentrics without VK_KHR_fragment_shader_barycentric needs a vertex shader before it, 1 sSo 5 of the 11 get past the stop, and 4 are refused because the emulation would need 1,536 bytes more mesh output memory than ANV allows. Ruffle and Dusklight still hit the old message, which may be a draw this PR doesn't route. On the RTX 4070 Ti, which has both extensions, all 11 ran to the limit on
mainexcept Dusklight (posix_spawnp, unrelated) and Mario 64 (its own exit). The run with this PR there is still going, and I'll add it.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by kq62 on 2026-10-16T20:52:28Z.
Thanks, this is exactly the device this PR targets, and very useful.
On the four refusals: the shortfall is exactly 1536 bytes, which is 3 components x 128 primitives x 4 bytes. The per-primitive corner positions are stored as full vec4s, but the solve only needs x, y and w, so dropping z may bring these titles to exactly 32768. I'm checking the estimate against the spec's output memory formula before changing it, since it has to match how the driver counts.
Ruffle and Dusklight hit the vertex-path branch, so that's a different draw that this PR doesn't route. If you still have those logs, the shader preparation lines just before the stop would help for a separate issue.
AI-assisted: yes (Claude).
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-16T20:53:28Z.
The RTX 4070 Ti run with this head (same setup, NVIDIA 595.99.02, which has both extensions) matches
mainon all 11: the same nine reach 40–45 s, Mario 64 exits on its own at 8 s, and Dusklight stops on the unrelatedposix_spawnpcall (#6233). No new messages either way.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by kq62 on 2026-10-16T20:56:14Z.
Thanks, that confirms devices with the extension are unchanged, which I couldn't test myself. I've added both of your runs to the description.
Imported from boykopovar/AnyPS5. Originally posted by kq62 on 2026-10-16T21:13:45Z.
Follow-up on the four refusals: dropping z doesn't help. The spec's "Mesh Shader Output" formula counts whole locations (4 scalars each), so a vec3 costs the same as a vec4. Checking it also showed our estimate undercounted (vec3 varying as 3 scalars, CullPrimitiveEXT left out), so it now follows the formula exactly, with granularity and every declared built-in except primitive indices. For ccleste's configuration that is 36864 bytes, so those four apps stay refused on ANV's 32768, now with the correct number.
Fitting them needs packing several values into shared locations, which depends on which channels the pixel shader actually reads. I'll do that as a follow-up PR after this one, to keep this one reviewable. New head:
2d52296a8.AI-assisted: yes (Claude).
Imported from boykopovar/AnyPS5. Originally posted by keravyn-ops on 2026-10-17T09:21:39Z.
AMD / Windows run of this PR at 2d52296a8: Radeon 780M (RDNA 3, 0x15bf), AMD driver 25.10.20.01 (32.0.21020.1007), Windows 11 Home 10.0.26100, WinLibs GCC 15.2.0 r7, Release.
agc_driver_mesh_barycentric_emulation: pass (932 perspective and 932 linear I/J pixels, 932 raw vertex value pixels, 0.59 s)agc_mesh_output_budget: pass (0.17 s)agc_shader_disk_cache: pass (2.07 s)agc_shader_memory: pass (0.43 s)request_serializer: pass (0.06 s)AI-assisted: yes (runs made on the device above).
Imported from boykopovar/AnyPS5. Originally posted by kq62 on 2026-10-17T14:05:40Z.
Thanks for the AMD run. Good to see the new tests pass on RDNA 3 as well; I've added it to the description.
Imported from boykopovar/AnyPS5. Originally posted by kq62 on 2026-10-18T06:47:40Z.
Rebased on
66e71b63d(after #7308). The emulated interface is nowDescribeEmulatedInterface, split out of #7308'sCollectEmulatedInterface, so the geometry, tessellation and mesh routes share it.FormatVersionis 38; the Linux size asserts stay at main's value plus 40 bytes (280 and 512), checked with GCC 13.3 at the first and last commit. Full ctest: 1475 of 1478, with the three failures also seen onmainor flaky. ccleste still renders correctly on the Arc. New head:24bb8b0c0.AI-assisted: yes (Claude).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T22:21:17Z.
Rebased onto current
main(it movedDraw.cpp; the stencil value export had already taken request serializer version 37, so this PR's mesh barycentric field is now version 38; onlyRequestSerializerTests.cppconflicted). I also updatedagc_shader_memory, which still expected 37 and treated 38 as unsupported. No logic changed. The 3x3 barycentric solve, per-vertex staging in workgroup memory, output/shared-memory budget checks and cache key/serializer plumbing were checked earlier on this head; third-party runs on RTX 4070 Ti (ANV) and Radeon 780M confirm it on hardware; merged.