Skip to content

fix(agc): refuse mesh-path draws on a device without mesh shaders before validating them - #6523

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
billythemenace2:fix/agc-mesh-support-before-validation
Oct 19, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
billythemenace2:fix/agc-mesh-support-before-validation

Conversation

@billythemenace2

Copy link
Copy Markdown

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:

AGC graphics: subgroup capability 61 is unsupported for shader stage 128

The device does not support mesh shaders check in Draw.cpp came only after validation.

After: ValidateShaders takes the device's mesh shader support and refuses a mesh-path draw first, so the same draw stops with:

AGC graphics: device does not support mesh shaders

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

ValidateShaders gets a trailing meshShader parameter (default true, so existing callers and tests keep their behaviour), and Draw.cpp passes context.meshShader. The check sits right after the existing path and stage-configuration checks, before any shader is inspected. Graphics.cpp adds a case: the decoded NGG mesh state is validated with meshShader false 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 main b7cedd900. agc_driver_graphics passes, and fails with the check removed. tools/check_conventions.py --base origin/main passes. Sackboy (PPSA01289), with #6236 and APS5_PLAYGO_UNLISTED_CHUNKS=absent, now stops with device does not support mesh shaders instead of the subgroup error. Not tested: Linux, a GPU with mesh shaders (the check passes there because meshShader is true).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none (it only makes PPSA01289's stop on GPUs without mesh shaders report its cause)
  • GPUs tested: AMD Radeon RX 5700 XT, driver 32.0.21045.5002, Windows 11
  • AI-assisted: yes

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 1368 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4072 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
PR 5431 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5441 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5499 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5500 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6194 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6457 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6479 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6481 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6503 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
PR 6529 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6535 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6563 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6612 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6639 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6647 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6683 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6718 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6727 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6730 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6762 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6763 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6804 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6820 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6941 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
PR 6946 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6947 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
PR 6970 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6972 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7085 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7254 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7310 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7332 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7340 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7369 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7410 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp

@coltken95

Copy link
Copy Markdown

Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with 4e35f3a merged into main 44df216:

  • With the PR: all 8 tests built from Graphics.cpp pass, including the new device does not support mesh shaders check in agc_driver_graphics.
  • No comparison against main: the new check calls ValidateShaders with the mesh-support argument this PR adds, so Graphics.cpp doesn't build without the change.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added agc libSceAgc* needs rebase Conflicts with main, rebase needed labels Oct 16, 2026
@blawesom

Copy link
Copy Markdown
Contributor

Rebase handoff — rebased onto current main (authorship unchanged). The conflicts were the ValidateShaders signature in three files: main added shaderTerminateInvocation as the next-to-last flag while this PR appends meshShader, so the merged signature carries both. Two merge adaptations were needed for your test in Graphics.cpp: the positional-false call needed one more argument so meshShader is actually false rather than left at its = true default (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):

  • builds; tools/check_conventions.py --base origin/main passes
  • full suite: 1286/1287 — the only consistent failure is the known main regression (agc_driver_tessellation segfault, feat(shader): read hull inputs at a control-point index computed from data #4727)
  • one observation: agc_driver_same_queue_label_wait failed 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 on main today

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/6523
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is 68e90bb3d.

@blawesom

Copy link
Copy Markdown
Contributor

Correction on the agc_driver_same_queue_label_wait observation 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.

@billythemenace2

Copy link
Copy Markdown
Author

@blawesom thank you for the rebase and the full-suite run. I've taken it as is: the branch is now at 68e90bb3d on main 66e290f1c, and GitHub reports it mergeable again. Thanks also for following up on the label-wait flake.

AI-assisted (Claude Code).

@github-actions github-actions Bot added unblocks title Names a title ID on the Unblocks line needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 16, 2026
@adriadam10 adriadam10 self-assigned this Oct 19, 2026
@MaxLikesCode

Copy link
Copy Markdown
Contributor

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=ON with every execution test built. This head (68e90bb) merged into main ad502d7.

AI-assisted: yes (Claude Code)

…ore validating them

A draw on the mesh path was validated before its pipeline checked for
mesh shader support, so on a device without VK_EXT_mesh_shader (an RDNA1
RX 5700 XT) Sackboy: A Big Adventure (PPSA01289) stopped on "subgroup
capability 61 is unsupported for shader stage 128" instead of the actual
cause. ValidateShaders now takes the device's mesh shader support and
refuses such a draw first with "device does not support mesh shaders".

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@adriadam10
adriadam10 force-pushed the fix/agc-mesh-support-before-validation branch from 68e90bb to 60a2aa4 Compare October 19, 2026 03:47
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 19, 2026
@adriadam10
adriadam10 merged commit ceab3dd into boykopovar:main Oct 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants