fix(agc): accept cull distances from tessellation evaluation shaders #13492
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13492"
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 wrocketdev on 2026-10-30T16:56:25Z.
What
ValidateShadersacceptedgl_CullDistanceoutputs only from vertex and mesh shaders, while it acceptedgl_ClipDistancefrom tessellation too. The recompiler already declares and stores both for a tessellation evaluation shader, and Vulkan allows both there, so any tessellated draw with a guest cull distance aborted, on any GPU, with a misleading message:AGC graphics: vertex clip or cull distance needs shaderClipDistance or shaderCullDistance, which the device lacks (PA_CL_VS_OUT_CNTL=0x00400403)This accepts the
CullDistancebuilt-in and capability in the tessellation evaluation stage. The device feature is still required: withoutshaderCullDistancethe draw is refused with the same message. The tessellation control stage is unchanged, because the guest's distances are exported from the stage that writes position.validationTestsgains a tessellation pipeline whose evaluation shader writes cull distances, accepted withshaderCullDistanceand refused without it.makeModulegainstessellationModelfor that.Tested
Windows 11 Pro (build 26300), Intel Core i5-12600KF, NVIDIA GeForce RTX 3060 Ti (driver 617.42), WinLibs GCC 15.2.0 r7, Release, on
mainad2fbd74cd.ctest -R '^agc_driver_graphics$'passes. Without theShaderValidation.cppchange the new case fails with the message above.PA_CL_VS_OUT_CNTL=0x00400403after the title screen. With this change it reaches gameplay in the first area, no abort, noNotImplemented.main556547da71: the four tests below pass again andtools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.pyreports no overlap; it could not compare 23 conflicting pull requests, of which the five that touchShaderValidation.cppdo not change this check.ctest -R '^agc_driver_(graphics|tessellation|vertex_clip_cull_distances|vertex_clip_cull_draw)$' -VwithANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(Vulkan SDK 1.4.363.0) passes onmainand on this change, with no missing-layer line and noVUID-line in either log;VK_LOADER_DEBUG=layerconfirms the layer is inserted. None of these tests draws tessellated geometry with a cull distance, and the game was not run under the layer, so that exact path has no validation-layer coverage.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