feat(agc): clip and cull distances on the mesh path #5323
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5323"
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 lubaxe on 2026-10-13T17:12:38Z.
What
#423 added clip and cull distances for vertex shaders on the vertex path. A vertex program that runs on the mesh path (NGG,
ShaderPath::Geometry) and exports distances throughPA_CL_VS_OUT_CNTLstill failed to recompile withunsupported mesh output kind. PPSA06694 (Remnant 2) stops on this 7 s after start.DefineMeshOutputsdefinesgl_ClipDistanceandgl_CullDistanceas per-vertex arrays (float[N]per vertex,Nthe highest distance index used plus one), with a private per-lane copy for each distance like the other mesh outputs.EmitAuxPositionExportstores a distance into that per-lane copy on the mesh path, andEmitMeshEntryPointwrites it to the vertex's element of the built-in array.ShaderValidationaccepts the two built-ins and theClipDistance/CullDistancecapabilities in mesh shaders, under the same device feature checks as vertex shaders.The all-zero-position clip distance that vertex and tessellation evaluation shaders get is not added on the mesh path, as before.
Tested
agc_driver_vertex_clip_cull_distancesnow draws its seven rows (clip planes, cull planes, sparse enables) a second time through an NGG program on the mesh path, and checks every pixel. The program is the one fromLayeredVolumeDraw.cpp, withpos1exporting four components. Onmainthe mesh rows fail withunsupported mesh output kind. The mesh rows are skipped on a device withoutVK_EXT_mesh_shader.ctestonmain8c772ad3with this change: 1076 of 1077 passed. The failure isagc_driver_pixel_lds, which also fails on unmodifiedmainon this GPU. Rebased ontomain61b8742b; thereagc_driver_graphics,guest_np_authandagc_driver_vertex_clip_cull_distancespass.mainit stops at the first such shader.tools/check_conventions.py --base origin/mainpasses.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)🤖 Generated with Claude Code