fix(agc): refuse mesh-path draws on a device without mesh shaders before validating them #6523
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6523"
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 billythemenace2 on 2026-10-15T18:41:45Z.
Requested by billy
What
Before: on a device without
VK_EXT_mesh_shader, a draw on the mesh path (an NGG geometry or fast-launch program) was validated before anything checked for mesh shader support. A mesh shader that uses subgroup operations then stopped on a misleading error. Sackboy: A Big Adventure (PPSA01289) on an AMD Radeon RX 5700 XT (RDNA1, no mesh shaders on AMD's Windows driver) stopped with:The
device does not support mesh shaderscheck inDraw.cppcame only after validation.After:
ValidateShaderstakes the device's mesh shader support and refuses a mesh-path draw first, so the same draw stops with:Nothing new runs. This only reports the real cause, so a tester on a GPU without mesh shaders knows the draw cannot work there rather than chasing a subgroup problem.
How
ValidateShadersgets a trailingmeshShaderparameter (defaulttrue, so existing callers and tests keep their behaviour), andDraw.cpppassescontext.meshShader. The check sits right after the existing path and stage-configuration checks, before any shader is inspected.Graphics.cppadds a case: the decoded NGG mesh state is validated withmeshShaderfalse and must fail with the new message.Tested
Windows 11 (26200), MinGW-w64 GCC 15, Release, AMD Radeon RX 5700 XT (driver 32.0.21045.5002), on
mainb7cedd900.agc_driver_graphicspasses, and fails with the check removed.tools/check_conventions.py --base origin/mainpasses. Sackboy (PPSA01289), with #6236 andAPS5_PLAYGO_UNLISTED_CHUNKS=absent, now stops withdevice does not support mesh shadersinstead of the subgroup error. Not tested: Linux, a GPU with mesh shaders (the check passes there becausemeshShaderis true).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
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T19:30:59Z.
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/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cppImported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-15T19:56:14Z.
Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with 4e35f3a9f merged into main
44df21632:Graphics.cpppass, including the newdevice does not support mesh shaderscheck inagc_driver_graphics.ValidateShaderswith the mesh-support argument this PR adds, soGraphics.cppdoesn't build without the change.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-16T17:34:51Z.
Rebase handoff — rebased onto current
main(authorship unchanged). The conflicts were theValidateShaderssignature in three files:mainaddedshaderTerminateInvocationas the next-to-last flag while this PR appendsmeshShader, so the merged signature carries both. Two merge adaptations were needed for your test inGraphics.cpp: the positional-falsecall needed one more argument someshShaderis actuallyfalserather than left at its= truedefault (otherwise the mesh refusal never fires and the stage-count check fails instead), and the arity fix follows from the same drift.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesmainregression (agc_driver_tessellationsegfault, #4727)agc_driver_same_queue_label_waitfailed in 2 of 4 parallel (-j8) runs on this head but passes solo and in re-runs — I could not tie it to this PR's validation-only diff, but flagging it in case it rings a bell; it did not fail onmaintodayTo pick it up:
Head is
68e90bb3d.Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-16T18:07:00Z.
Correction on the
agc_driver_same_queue_label_waitobservation above: I've since root-caused that flake to my machine, not this PR — after hours of continuous GPU test load the card heat-soaks (junction ~95°C) and that test's timing measurement (extra label-collect bumps vs. waits) flips; after four minutes idle (68°C) it passes again on the same build. Same commit, clean caches, unchanged driver — purely thermal. Please disregard the flake remark; nothing here to look at.Imported from boykopovar/AnyPS5. Originally posted by billythemenace2 on 2026-10-16T21:12:45Z.
@blawesom thank you for the rebase and the full-suite run. I've taken it as is: the branch is now at
68e90bb3donmain66e290f1c, and GitHub reports it mergeable again. Thanks also for following up on the label-wait flake.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by MaxLikesCode on 2026-10-19T02:56:37Z.
A run on a GPU that has mesh shaders, to check that nothing changes where the new refusal does not apply: NVIDIA GeForce RTX 4090, driver 617.42, Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ONwith every execution test built. This head (68e90bb3d) merged intomainad502d717.agc_driver_graphicspasses, and the build has no warnings.tools/select_tests.pyselects for this change: 957 pass, 15 skip and 3 fail.agc_driver_bda_device(#7584) andagc_driver_image_table_reuse(#7710) fail onmainon this GPU too.agc_driver_storage_file_writefailed once in the parallel run and passed 6 of 6 when rerun alone, so I take it for load-dependent and unrelated.agc_driver_pixel_lds(#7708), which fails onmainhere, passed in this run; it depends on timing.tools/check_skips.py --job windowsaccepts the skips.AI-assisted: yes (Claude Code)