fix(agc): let mesh-path list draws with primitive restart skip the list-restart emulation #17976
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17976"
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 Gonic0 on 2026-11-10T02:09:37Z.
What
Draw.cppemulates primitive restart in point, line and triangle lists on devices withoutVK_EXT_primitive_topology_list_restartby compacting the index buffer that the input assembler reads (#12180). That branch also stopped every mesh-path list draw with restart at a requirement for the extension. A mesh draw has no input assembler: its entry fetches the indices itself, so the compaction does not apply to it.A mesh-path list draw with primitive restart now skips the emulation and takes the same path as on a device with the extension:
skipRestartis set for it, so the index range is read with the restart index left out. The requirement is removed.The fix and its diagnosis are imellag's (comment on #9356), and the commit carries their authorship. It is opened on its own at the request of the author of #17611 (comment): #17611 is what lets mesh-path draws reach devices without
VK_EXT_mesh_shader, such as MoltenVK, and there the requirement stops PPSA21564 shortly after launch.Not changed: the mesh entry handles the restart index only in triangle strips and fans. In a list it is fetched as an ordinary index, as it already was on devices with the extension.
Tested
macOS 27.3, Apple M5 Pro, Apple clang, x86-64 Release under Rosetta 2. Tree:
main81eb4e1935with #17611 (7957c8eb77; its only conflict,FormatVersioninShaderDiskCache.hpp, set to 69), and #16591, #17425, #17532 and #17767, which macOS needs to build. The game binary was relinked from the same tree.PPSA21564 on MoltenVK 1.4.2 (which lists
VK_EXT_primitive_topology_list_restartbut reportsprimitiveTopologyListRestartas false), same save, cold shader cache, 150 s limit:mainAGC graphics: device does not support mesh shadersmain+ #17611primitive restart in a mesh list draw needs VK_EXT_primitive_topology_list_restartmain+ #17611 + this changectest -R '^(agc_driver_(graphics|layered_[a-z_]+|mesh[a-z_]*|pass_break_reasons|pass_input_hazard)|agc_mesh_output_budget)$'on MoltenVK 1.4.2 and KosmicKrisp (Mesamain), on the same pull requests overmain6c03f737f0(Draw.cppis unchanged since), with and without this change: 10 run and pass, 8 skip. The 8 are the mesh execution tests, which skip on both drivers because neither hasVK_EXT_mesh_shader, so no existing test reaches this path.Linux, Windows, AMD and NVIDIA: not run. On a device that supports
primitiveTopologyListRestartthe change does nothing:skipRestartwas already set for these draws.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)mainon its own, and #17611 is what makes the path reachable on devices withoutVK_EXT_mesh_shader🤖 Generated with Claude Code