fix(agc): decode a fast-launch draw as one point per subgroup whatever its input type #8395

Merged
hugodearaujo merged 7 commits from upstream-pr/8395 into main 2026-11-02 07:56:42 +00:00
hugodearaujo commented 2026-10-20 12:06:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-20T12:06:38Z.


What

DecodeState accepts VGT_SHADER_STAGES_EN.GS_FAST_LAUNCH = 1 only with a point list in VGT_PRIMITIVE_TYPE (#4702). A fast-launch draw with any other type and the same GE_CNTL group of one vertex and one primitive stops the title with fast launch other than one point per subgroup is unsupported.

This PR decodes such a draw as one point per subgroup whatever VGT_PRIMITIVE_TYPE holds:

  • Fast launch starts subgroups without assembling input primitives. RADV, which drives mesh shaders through this mode on gfx10.3, sets the input topology to a point list and takes the workgroup index from the vertex id (radv_shader_info.c; ac_nir_lower_ngg_mesh.c: "the vertex ID which is equivalent to the index of the current workgroup within the current dispatch").
  • GE_CNTL asks for one vertex per subgroup, which no line or triangle can fill, so the type cannot be what sizes the subgroup.

Other group sizes, fast launch 2 and indexed fast-launch draws still throw; the message for other group sizes now reads fast launch other than one vertex and one primitive per subgroup is unsupported. That a console starts one subgroup per vertex for a line or triangle type is assumed, not measured, and the technical debt entry says so.

Title

CONTROL Resonant (PPSA34547) makes fast-launch draws with VGT_SHADER_STAGES_EN 0x482030, VGT_PRIMITIVE_TYPE 6 (triangle strip) and GE_CNTL 0x201 right after New Game, as @ps54all reported in #7302; they got past it with a local change that treats the input as a point list.

On main 06d97be8b with #7064 (needed to reach New Game), Linux, RX 9070 XT with RADV, in the same run directory with only libSceAgcDriver.prx swapped:

  • without this PR, after New Game the title creates 8 pipelines whose programs are refused and deferred to their first use, for example Shader 0x10041aa500 could not be prepared when the title created its pipeline (AGC graphics: VGT_SHADER_STAGES_EN=0x482030: fast launch other than one point per subgroup is unsupported);
  • with it, no program is refused, and within 22 s of New Game APS5_TRACE_DRAW_PROGRAMS shows 6 of those 8 programs drawn on the mesh path (0x10041aa500 60 times). I stopped the run there.

Further on, the title loses the GPU after New Game with or without this PR: the run without it lost the device 2 min after New Game, before any of those programs was drawn. That loss is tracked in #7302.

Tested

  • main 5454cd2e45 merged in (f29635063c), by a merge commit; history is not rewritten. State.cpp conflicted because main moved the geometry subgroup decode into a meshConfiguration(inputPrimitive, fastLaunch) helper that the tessellation-geometry path also uses. The resolution keeps that helper and makes the same change as before: the fast-launch check no longer requires a point list, and the geometry path passes a point list as the input primitive for a fast-launch draw (meshConfiguration(fastLaunch ? 1u : primitive, fastLaunch)). The tests and the debt entry merged without conflicts. Against main, the diff is still 4 files, +16/-6.

  • Paired validation on one machine and GPU: AMD Radeon RX 9070 XT (RADV GFX1201, Mesa 26.2.6), Arch Linux with kernel 7.2.11, GCC 16.2.1, Release. ctest -V -R '^(agc_driver|agc_driver_graphics|agc_driver_mesh)$' with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Khronos layer 1.4.363), ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 and VK_LOADER_DEBUG=layer:

    Commit Result Insert instance layer "VK_LAYER_KHRONOS_validation" was not found but was requested VUID- lines
    main 5454cd2e45 3 of 3 pass 3 0 0
    this head f29635063c 3 of 3 pass 3 0 0

    In each run agc_driver inserts the layer twice and agc_driver_mesh once; agc_driver_graphics, which holds the decode test, creates no Vulkan instance.

  • Negative control, main 5454cd2e45 with only this PR's test changes, same settings: both tests that hold the new checks fail. agc_driver_graphics fails with AGC graphics: unexpected failure: AGC graphics: VGT_SHADER_STAGES_EN=0x482030: fast launch other than one point per subgroup is unsupported, and agc_driver with a registered fast-launch program resolved with a triangle strip was not prepared as for a point list. agc_driver_mesh passes.

  • c65b4eff5f, on top of that head, only adds type 21 (the polygon type, which DecodeState also accepts on this path) to the decode test: the three tests pass on it with the layer inserted and no VUID- lines.

  • agc_driver_graphics: with fast launch and GE_CNTL 0x201, VGT_PRIMITIVE_TYPE 2 to 6 and 21 decode as the point list does (one point per subgroup, PRIM_AMP_FACTOR primitives); GE_CNTL 0x402 is still refused.

  • agc_driver: the registered fast-launch program from #6150 is resolved with a triangle strip before the point list, and the point list has to reuse the artifact the strip prepared (Driver::PreparedEntryHashes is the same after both resolves). On the RX 9070 XT the strip prepares one entry, with the same hash as the entry main prepares for the point list. With main's State.cpp the strip's decode fails and the stage stays deferred (without a log line, since it is already deferred at registration), so the point list prepares the program itself and the check fails. A device that cannot prepare the program for either type has nothing to compare; the decode itself is covered by agc_driver_graphics, which needs no GPU.

  • The fast-launch mesh draws of agc_driver_mesh pass unchanged: the draw side still receives a point list.

  • Earlier revisions of the same change, not repeated on this base:

    • Full CTest with -j8, ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1 on the same machine, on main 74acfad65b: main and fb4caca45f (the head before its last, test-only commit) both pass 2396 of 2431 tests. On both, the same 34 tests are skipped and agc_driver_tessellation segfaults (#5444).
    • Windows Server 2025 VM, WinLibs GCC 15.2, Release, BUILD_TESTING=ON, on main 06d97be8b. The VM has no GPU, so the GPU tests do not run there: of 1704 tests, 1077 pass, 627 are skipped, nearly all of them GPU tests (agc_driver and agc_driver_mesh among them), and none fails. agc_driver_graphics, which holds the decode test above, runs and passes there.
    • Windows 10 Pro 22H2, WinLibs GCC 15.2.0, Release, head 75720e0de, run by @TheSovietWaffle: on an RTX 3080 (NVIDIA 617.42) and an AMD Radeon RDNA 2 iGPU (1002:164e, 32.0.21045.5002), agc_driver_graphics, agc_driver, agc_driver_mesh and agc_driver_tessellation pass 3 of 3 on both GPUs (that Radeon driver reports no mesh shaders).
    • The CONTROL Resonant runs under Title, on main 06d97be8b with #7064.
  • tools/check_conventions.py --base origin/main --head f29635063c with this title and description passes, and git diff --check is clean.

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
  • Fixes: none
  • Unblocks: PPSA34547 #7302
  • GPUs tested: AMD Radeon RX 9070 XT, RADV (Mesa 26.2.5 and 26.2.6), Arch Linux
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4935468933 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8395). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-10-20T12:06:38Z. --- ### What `DecodeState` accepts `VGT_SHADER_STAGES_EN.GS_FAST_LAUNCH = 1` only with a point list in `VGT_PRIMITIVE_TYPE` (#4702). A fast-launch draw with any other type and the same `GE_CNTL` group of one vertex and one primitive stops the title with `fast launch other than one point per subgroup is unsupported`. This PR decodes such a draw as one point per subgroup whatever `VGT_PRIMITIVE_TYPE` holds: - Fast launch starts subgroups without assembling input primitives. RADV, which drives mesh shaders through this mode on gfx10.3, sets the input topology to a point list and takes the workgroup index from the vertex id (`radv_shader_info.c`; `ac_nir_lower_ngg_mesh.c`: "the vertex ID which is equivalent to the index of the current workgroup within the current dispatch"). - `GE_CNTL` asks for one vertex per subgroup, which no line or triangle can fill, so the type cannot be what sizes the subgroup. Other group sizes, fast launch 2 and indexed fast-launch draws still throw; the message for other group sizes now reads `fast launch other than one vertex and one primitive per subgroup is unsupported`. That a console starts one subgroup per vertex for a line or triangle type is assumed, not measured, and the technical debt entry says so. ### Title CONTROL Resonant (PPSA34547) makes fast-launch draws with `VGT_SHADER_STAGES_EN` 0x482030, `VGT_PRIMITIVE_TYPE` 6 (triangle strip) and `GE_CNTL` 0x201 right after New Game, as @ps54all reported in [#7302](https://github.com/boykopovar/AnyPS5/discussions/7302); they got past it with a local change that treats the input as a point list. On `main` 06d97be8b with #7064 (needed to reach New Game), Linux, RX 9070 XT with RADV, in the same run directory with only `libSceAgcDriver.prx` swapped: - without this PR, after New Game the title creates 8 pipelines whose programs are refused and deferred to their first use, for example `Shader 0x10041aa500 could not be prepared when the title created its pipeline (AGC graphics: VGT_SHADER_STAGES_EN=0x482030: fast launch other than one point per subgroup is unsupported)`; - with it, no program is refused, and within 22 s of New Game `APS5_TRACE_DRAW_PROGRAMS` shows 6 of those 8 programs drawn on the mesh path (`0x10041aa500` 60 times). I stopped the run there. Further on, the title loses the GPU after New Game with or without this PR: the run without it lost the device 2 min after New Game, before any of those programs was drawn. That loss is tracked in #7302. ### Tested - **`main` 5454cd2e45 merged in** (f29635063c), by a merge commit; history is not rewritten. `State.cpp` conflicted because `main` moved the geometry subgroup decode into a `meshConfiguration(inputPrimitive, fastLaunch)` helper that the tessellation-geometry path also uses. The resolution keeps that helper and makes the same change as before: the fast-launch check no longer requires a point list, and the geometry path passes a point list as the input primitive for a fast-launch draw (`meshConfiguration(fastLaunch ? 1u : primitive, fastLaunch)`). The tests and the debt entry merged without conflicts. Against `main`, the diff is still 4 files, +16/-6. - Paired validation on one machine and GPU: AMD Radeon RX 9070 XT (RADV GFX1201, Mesa 26.2.6), Arch Linux with kernel 7.2.11, GCC 16.2.1, Release. `ctest -V -R '^(agc_driver|agc_driver_graphics|agc_driver_mesh)$'` with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (Khronos layer 1.4.363), `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1` and `VK_LOADER_DEBUG=layer`: | Commit | Result | `Insert instance layer "VK_LAYER_KHRONOS_validation"` | `was not found but was requested` | `VUID-` lines | |---|---|---:|---:|---:| | `main` 5454cd2e45 | 3 of 3 pass | 3 | 0 | 0 | | this head f29635063c | 3 of 3 pass | 3 | 0 | 0 | In each run `agc_driver` inserts the layer twice and `agc_driver_mesh` once; `agc_driver_graphics`, which holds the decode test, creates no Vulkan instance. - Negative control, `main` 5454cd2e45 with only this PR's test changes, same settings: both tests that hold the new checks fail. `agc_driver_graphics` fails with `AGC graphics: unexpected failure: AGC graphics: VGT_SHADER_STAGES_EN=0x482030: fast launch other than one point per subgroup is unsupported`, and `agc_driver` with `a registered fast-launch program resolved with a triangle strip was not prepared as for a point list`. `agc_driver_mesh` passes. - c65b4eff5f, on top of that head, only adds type 21 (the polygon type, which `DecodeState` also accepts on this path) to the decode test: the three tests pass on it with the layer inserted and no `VUID-` lines. - `agc_driver_graphics`: with fast launch and `GE_CNTL` 0x201, `VGT_PRIMITIVE_TYPE` 2 to 6 and 21 decode as the point list does (one point per subgroup, `PRIM_AMP_FACTOR` primitives); `GE_CNTL` 0x402 is still refused. - `agc_driver`: the registered fast-launch program from #6150 is resolved with a triangle strip before the point list, and the point list has to reuse the artifact the strip prepared (`Driver::PreparedEntryHashes` is the same after both resolves). On the RX 9070 XT the strip prepares one entry, with the same hash as the entry `main` prepares for the point list. With `main`'s `State.cpp` the strip's decode fails and the stage stays deferred (without a log line, since it is already deferred at registration), so the point list prepares the program itself and the check fails. A device that cannot prepare the program for either type has nothing to compare; the decode itself is covered by `agc_driver_graphics`, which needs no GPU. - The fast-launch mesh draws of `agc_driver_mesh` pass unchanged: the draw side still receives a point list. - Earlier revisions of the same change, not repeated on this base: - Full CTest with `-j8`, `ANYPS5_REQUIRE_VULKAN=1` and `ANYPS5_NO_SHADER_CACHE=1` on the same machine, on `main` 74acfad65b: `main` and fb4caca45f (the head before its last, test-only commit) both pass 2396 of 2431 tests. On both, the same 34 tests are skipped and `agc_driver_tessellation` segfaults (#5444). - Windows Server 2025 VM, WinLibs GCC 15.2, Release, `BUILD_TESTING=ON`, on `main` 06d97be8b. The VM has no GPU, so the GPU tests do not run there: of 1704 tests, 1077 pass, 627 are skipped, nearly all of them GPU tests (`agc_driver` and `agc_driver_mesh` among them), and none fails. `agc_driver_graphics`, which holds the decode test above, runs and passes there. - Windows 10 Pro 22H2, WinLibs GCC 15.2.0, Release, head `75720e0de`, run by @TheSovietWaffle: on an RTX 3080 (NVIDIA 617.42) and an AMD Radeon RDNA 2 iGPU (`1002:164e`, 32.0.21045.5002), `agc_driver_graphics`, `agc_driver`, `agc_driver_mesh` and `agc_driver_tessellation` pass 3 of 3 on both GPUs (that Radeon driver reports no mesh shaders). - The CONTROL Resonant runs under Title, on `main` 06d97be8b with #7064. - `tools/check_conventions.py --base origin/main --head f29635063c` with this title and description passes, and `git diff --check` is clean. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: PPSA34547 #7302 - [x] GPUs tested: AMD Radeon RX 9070 XT, RADV (Mesa 26.2.5 and 26.2.6), Arch Linux - [x] AI-assisted: yes
hugodearaujo commented 2026-10-20 12:17:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-20T12:17:53Z.


On the two pull requests with conflicting lines, neither implements this change nor depends on it:

  • #6612 moves this block of DecodeShaderStages into a meshConfiguration(inputPrimitive, fastLaunch) lambda, to draw tessellation followed by an NGG geometry stage, and keeps fast launch limited to a point list. Whichever lands second passes a point list to the lambda for a fast-launch draw (fastLaunch ? 1u : primitive) and keeps this PR's check on the group size.
  • #6801 changes the VGT_GS_OUT_PRIM_TYPE check on the line above and adds a technical debt entry next to the GS_FAST_LAUNCH one; the two only touch neighbouring lines.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6290655418 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8395#issuecomment-6290655418). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-10-20T12:17:53Z. --- On the two pull requests with conflicting lines, neither implements this change nor depends on it: - #6612 moves this block of `DecodeShaderStages` into a `meshConfiguration(inputPrimitive, fastLaunch)` lambda, to draw tessellation followed by an NGG geometry stage, and keeps fast launch limited to a point list. Whichever lands second passes a point list to the lambda for a fast-launch draw (`fastLaunch ? 1u : primitive`) and keeps this PR's check on the group size. - #6801 changes the `VGT_GS_OUT_PRIM_TYPE` check on the line above and adds a technical debt entry next to the GS_FAST_LAUNCH one; the two only touch neighbouring lines.
TheSovietWaffle commented 2026-10-20 13:47:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TheSovietWaffle on 2026-10-20T13:47:50Z.


NVIDIA and AMD proprietary data point: RTX 3080 (NVIDIA 617.42) and AMD Radeon RDNA 2 iGPU (1002:164e, 32.0.21045.5002), Windows 10 Pro 22H2, WinLibs GCC 15.2.0, Release, head 75720e0de: agc_driver_graphics, agc_driver, agc_driver_mesh and agc_driver_tessellation pass 3 of 3 on both GPUs (this Radeon driver reports no mesh shaders).

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6292381739 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8395#issuecomment-6292381739). Originally posted by [TheSovietWaffle](https://github.com/TheSovietWaffle) on 2026-10-20T13:47:50Z. --- NVIDIA and AMD proprietary data point: RTX 3080 (NVIDIA 617.42) and AMD Radeon RDNA 2 iGPU (`1002:164e`, 32.0.21045.5002), Windows 10 Pro 22H2, WinLibs GCC 15.2.0, Release, head `75720e0de`: `agc_driver_graphics`, `agc_driver`, `agc_driver_mesh` and `agc_driver_tessellation` pass 3 of 3 on both GPUs (this Radeon driver reports no mesh shaders). AI-assisted: yes (Claude Code).
hugodearaujo commented 2026-10-21 12:23:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-21T12:23:02Z.


@TheSovietWaffle Thanks, that is the first run of this change on NVIDIA and on AMD's own driver; I only had RADV. I added it to the Tested section.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6315799364 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8395#issuecomment-6315799364). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-10-21T12:23:02Z. --- @TheSovietWaffle Thanks, that is the first run of this change on NVIDIA and on AMD's own driver; I only had RADV. I added it to the Tested section.
XairRrR commented 2026-10-29 13:00:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T13:00:36Z.

Review: APPROVED


Reviewed — approved

The change decodes a GS_FAST_LAUNCH = 1 draw with a one-vertex, one-primitive GE_CNTL group as one point per subgroup whatever VGT_PRIMITIVE_TYPE holds. It merges cleanly, builds, and the focused AGC tests pass with the Khronos validation layer and no VUID- lines on either side. The negative control fails both new checks on an NVIDIA GPU as well as on the author's RADV.

What I ran

  • PR head: f29635063ca9e80488a1f6f18b1e4d12147e3742
  • main: 899ae3d1ad32ccea94dc24e66fdc948ce8a88171
  • Merged tree (main + head, --no-ff): d99ad97ab97e7d05f3625c86c3646bacc1e270fa, no conflicts
  • Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), in a clean worktree
git fetch origin main pull/8395/head:refs/review/8395
git checkout --detach origin/main && git merge --no-ff --no-edit refs/review/8395
git diff --check origin/main...refs/review/8395
python3 tools/check_conventions.py --base origin/main
nice -n 10 cmake --build build -j10 --target agc_driver_tests agc_driver_graphics_tests agc_driver_mesh_tests
nice -n 10 cmake --build build -j10 --target libs agc_driver_tests agc_driver_graphics_tests agc_driver_mesh_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  nice -n 10 ctest --test-dir build -R '^(agc_driver|agc_driver_graphics|agc_driver_mesh)$' -V --output-on-failure -j4
# the same build and ctest command on origin/main (899ae3d1ad) in the same worktree
# negative control: git checkout origin/main -- core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp, rebuild, the same ctest command

Results

Check Result
Merge with main Clean
git diff --check Clean
tools/check_conventions.py --base origin/main All conventions checks passed.
Build (libs and the three test targets) OK
agc_driver, agc_driver_graphics, agc_driver_mesh on the merged tree, with validation 3 of 3 pass
The same on main 3 of 3 pass
Insert instance layer "VK_LAYER_KHRONOS_validation" 3 on main, 3 on the merged tree
was not found but was requested by env var VK_INSTANCE_LAYERS 0 on both
VUID- lines 0 on both
Test durations 1.6 s, 4.7 s and 6.1 s; all under 30 s
Negative control agc_driver and agc_driver_graphics fail, agc_driver_mesh passes
Merged tree
959: Mesh tests passed
1/3 Test #959: agc_driver_mesh ..................   Passed    1.58 sec
934: AGC driver submit tests passed
2/3 Test #934: agc_driver .......................   Passed    4.67 sec
957: Graphics validation tests passed
3/3 Test #957: agc_driver_graphics ..............   Passed    6.14 sec
100% tests passed out of 3
main
1/3 Test #959: agc_driver_mesh ..................   Passed    1.75 sec
2/3 Test #934: agc_driver .......................   Passed    4.66 sec
3/3 Test #957: agc_driver_graphics ..............   Passed    5.52 sec
100% tests passed out of 3

Negative control

I restored only core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp from main, kept the PR's tests, rebuilt and ran the same command. Both tests that hold the new checks fail:

Output
957: AGC graphics: unexpected failure: AGC graphics: VGT_SHADER_STAGES_EN=0x482030: fast launch other than one point per subgroup is unsupported
1/3 Test #957: agc_driver_graphics ..............***Failed    0.17 sec
934: a registered fast-launch program resolved with a triangle strip was not prepared as for a point list
2/3 Test #934: agc_driver .......................***Failed    0.82 sec
3/3 Test #959: agc_driver_mesh ..................   Passed    1.54 sec
33% tests passed, 2 tests failed out of 3

This confirms the description's negative control on a second vendor. The PreparedEntryHashes comparison in agc_driver also detects the change on NVIDIA, so on this device it is not just two empty sets compared with each other.

Findings

Blocking

None.

Non-blocking

  1. state.topology still follows VGT_PRIMITIVE_TYPE for a fast-launch draw, so the provoking-vertex checks can refuse the draw with a misleading message. DecodeShaderStages now gives the mesh a point list (State.cpp:1332). DecodeState still sets topology from the raw type, so types 5 and 21 give TRIANGLE_FAN (State.cpp:1512-1515). With last provoking vertex observed, a fast-launch draw of type 5 or 21 therefore throws last provoking vertex is unsupported for triangle fans assembled for a geometry program (Pipeline.cpp:234-236), although this path assembles no fan. A strip type hits the same problem through the per-vertex triangle-strip interpolation check (Pipeline.cpp:242). Both checks throw instead of drawing anything wrong, so this is not a correctness bug. Still, once a title reaches them they will point at the wrong cause. A follow-up could key the fan check on state.stages.mesh->inputPrimitive rather than state.topology.
  2. Type 21 is accepted but not tested. The decode test loops over types 2 to 6 (tests/Graphics.cpp:1187). DecodeState also accepts type 21 on this path (State.cpp:1513), and now decodes it as a point list. Adding 21u to the list would cover every type that the PR newly accepts on the fast-launch path. Types 7, 17 and 19 still throw because they require vertex routing.

Not verified

  • Whether the console starts one subgroup per vertex for a line or triangle VGT_PRIMITIVE_TYPE under fast launch. The PR states this as an assumption and records it in the debt entry. I did not check the RADV sources that the description cites.
  • The CONTROL Resonant (PPSA34547) runs. I launched no title.
  • AMD and Windows runs. I ran on NVIDIA under Linux only.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5698076858 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8395#pullrequestreview-5698076858). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T13:00:36Z. **Review:** APPROVED --- # Reviewed — approved The change decodes a `GS_FAST_LAUNCH = 1` draw with a one-vertex, one-primitive `GE_CNTL` group as one point per subgroup whatever `VGT_PRIMITIVE_TYPE` holds. It merges cleanly, builds, and the focused AGC tests pass with the Khronos validation layer and no `VUID-` lines on either side. The negative control fails both new checks on an NVIDIA GPU as well as on the author's RADV. ## What I ran - PR head: `f29635063ca9e80488a1f6f18b1e4d12147e3742` - `main`: `899ae3d1ad32ccea94dc24e66fdc948ce8a88171` - Merged tree (`main` + head, `--no-ff`): `d99ad97ab97e7d05f3625c86c3646bacc1e270fa`, no conflicts - Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), in a clean worktree ```sh git fetch origin main pull/8395/head:refs/review/8395 git checkout --detach origin/main && git merge --no-ff --no-edit refs/review/8395 git diff --check origin/main...refs/review/8395 python3 tools/check_conventions.py --base origin/main nice -n 10 cmake --build build -j10 --target agc_driver_tests agc_driver_graphics_tests agc_driver_mesh_tests nice -n 10 cmake --build build -j10 --target libs agc_driver_tests agc_driver_graphics_tests agc_driver_mesh_tests VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ nice -n 10 ctest --test-dir build -R '^(agc_driver|agc_driver_graphics|agc_driver_mesh)$' -V --output-on-failure -j4 # the same build and ctest command on origin/main (899ae3d1ad) in the same worktree # negative control: git checkout origin/main -- core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp, rebuild, the same ctest command ``` ## Results | Check | Result | |---|---| | Merge with `main` | Clean | | `git diff --check` | Clean | | `tools/check_conventions.py --base origin/main` | `All conventions checks passed.` | | Build (`libs` and the three test targets) | OK | | `agc_driver`, `agc_driver_graphics`, `agc_driver_mesh` on the merged tree, with validation | 3 of 3 pass | | The same on `main` | 3 of 3 pass | | `Insert instance layer "VK_LAYER_KHRONOS_validation"` | 3 on `main`, 3 on the merged tree | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | 0 on both | | `VUID-` lines | 0 on both | | Test durations | 1.6 s, 4.7 s and 6.1 s; all under 30 s | | Negative control | `agc_driver` and `agc_driver_graphics` fail, `agc_driver_mesh` passes | <details><summary>Merged tree</summary> ``` 959: Mesh tests passed 1/3 Test #959: agc_driver_mesh .................. Passed 1.58 sec 934: AGC driver submit tests passed 2/3 Test #934: agc_driver ....................... Passed 4.67 sec 957: Graphics validation tests passed 3/3 Test #957: agc_driver_graphics .............. Passed 6.14 sec 100% tests passed out of 3 ``` </details> <details><summary>main</summary> ``` 1/3 Test #959: agc_driver_mesh .................. Passed 1.75 sec 2/3 Test #934: agc_driver ....................... Passed 4.66 sec 3/3 Test #957: agc_driver_graphics .............. Passed 5.52 sec 100% tests passed out of 3 ``` </details> ## Negative control I restored only `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp` from `main`, kept the PR's tests, rebuilt and ran the same command. Both tests that hold the new checks fail: <details><summary>Output</summary> ``` 957: AGC graphics: unexpected failure: AGC graphics: VGT_SHADER_STAGES_EN=0x482030: fast launch other than one point per subgroup is unsupported 1/3 Test #957: agc_driver_graphics ..............***Failed 0.17 sec 934: a registered fast-launch program resolved with a triangle strip was not prepared as for a point list 2/3 Test #934: agc_driver .......................***Failed 0.82 sec 3/3 Test #959: agc_driver_mesh .................. Passed 1.54 sec 33% tests passed, 2 tests failed out of 3 ``` </details> This confirms the description's negative control on a second vendor. The `PreparedEntryHashes` comparison in `agc_driver` also detects the change on NVIDIA, so on this device it is not just two empty sets compared with each other. ## Findings ### Blocking None. ### Non-blocking 1. **`state.topology` still follows `VGT_PRIMITIVE_TYPE` for a fast-launch draw, so the provoking-vertex checks can refuse the draw with a misleading message.** `DecodeShaderStages` now gives the mesh a point list ([State.cpp:1332](https://github.com/boykopovar/AnyPS5/blob/f29635063ca9e80488a1f6f18b1e4d12147e3742/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L1332-L1332)). `DecodeState` still sets `topology` from the raw type, so types 5 and 21 give `TRIANGLE_FAN` ([State.cpp:1512-1515](https://github.com/boykopovar/AnyPS5/blob/f29635063ca9e80488a1f6f18b1e4d12147e3742/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L1512-L1515)). With last provoking vertex observed, a fast-launch draw of type 5 or 21 therefore throws `last provoking vertex is unsupported for triangle fans assembled for a geometry program` ([Pipeline.cpp:234-236](https://github.com/boykopovar/AnyPS5/blob/899ae3d1ad32ccea94dc24e66fdc948ce8a88171/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp#L234-L236)), although this path assembles no fan. A strip type hits the same problem through the per-vertex triangle-strip interpolation check ([Pipeline.cpp:242](https://github.com/boykopovar/AnyPS5/blob/899ae3d1ad32ccea94dc24e66fdc948ce8a88171/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp#L242-L242)). Both checks throw instead of drawing anything wrong, so this is not a correctness bug. Still, once a title reaches them they will point at the wrong cause. A follow-up could key the fan check on `state.stages.mesh->inputPrimitive` rather than `state.topology`. 2. **Type 21 is accepted but not tested.** The decode test loops over types 2 to 6 ([tests/Graphics.cpp:1187](https://github.com/boykopovar/AnyPS5/blob/f29635063ca9e80488a1f6f18b1e4d12147e3742/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp#L1187-L1187)). `DecodeState` also accepts type 21 on this path ([State.cpp:1513](https://github.com/boykopovar/AnyPS5/blob/f29635063ca9e80488a1f6f18b1e4d12147e3742/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L1513-L1513)), and now decodes it as a point list. Adding `21u` to the list would cover every type that the PR newly accepts on the fast-launch path. Types 7, 17 and 19 still throw because they require vertex routing. ## Not verified - Whether the console starts one subgroup per vertex for a line or triangle `VGT_PRIMITIVE_TYPE` under fast launch. The PR states this as an assumption and records it in the debt entry. I did not check the RADV sources that the description cites. - The CONTROL Resonant (PPSA34547) runs. I launched no title. - AMD and Windows runs. I ran on NVIDIA under Linux only.
XairRrR commented 2026-10-29 13:31:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T13:31:20Z.

Review: APPROVED


Re-checked — approved

The only new commit, c65b4eff5f, adds VGT_PRIMITIVE_TYPE 21 to the fast-launch decode test, as my previous review suggested. The merge with current main is clean, the focused AGC tests pass with the Khronos validation layer and log no VUID- lines on either side, and the new type 21 case fails on its own against main's State.cpp.

What changed since my last review

What I ran

  • PR head: c65b4eff5f04f9587d9d220b8e87a654edff093c
  • main: 478b5f1a93c9bb1cb79e7578f4438a42d7381353
  • Merged tree (main + head, --no-ff): a69d18318712b1c2f42a9f7e5d9fa83b283874a4, no conflicts
  • Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), in a clean worktree
git fetch origin main pull/8395/head:refs/review/8395
git log --oneline f29635063c..refs/review/8395 && git diff f29635063c refs/review/8395
git checkout --detach origin/main && git merge --no-ff --no-edit refs/review/8395
git diff --check origin/main...refs/review/8395
python3 tools/check_conventions.py --base origin/main
nice -n 10 cmake --build build -j10 --target libs agc_driver_tests agc_driver_graphics_tests agc_driver_mesh_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  nice -n 10 ctest --test-dir build -R '^(agc_driver|agc_driver_graphics|agc_driver_mesh)$' -V --output-on-failure -j4
# the same build and ctest command on origin/main (478b5f1a93) in the same worktree
# negative control 1: merged tree, git checkout origin/main -- core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp, rebuild, the same ctest command
# negative control 2: as 1, with the decode loop narrowed to {21u}, then rebuild agc_driver_graphics_tests and run ctest -R '^agc_driver_graphics$'
Check Result
Merge with main Clean
git diff --check Clean
tools/check_conventions.py --base origin/main All conventions checks passed.
Build (libs and the three test targets), merged tree and main OK
agc_driver, agc_driver_graphics, agc_driver_mesh, merged tree, with validation 3 of 3 pass (4.8 s, 6.3 s, 1.4 s)
The same on main 3 of 3 pass (4.8 s, 6.0 s, 1.6 s)
Insert instance layer "VK_LAYER_KHRONOS_validation" 3 on main, 3 on the merged tree
was not found but was requested by env var VK_INSTANCE_LAYERS 0 on both
VUID- lines 0 on both
Negative control 1 (main's State.cpp) agc_driver and agc_driver_graphics fail, agc_driver_mesh passes
Negative control 2 (type 21 only, main's State.cpp) agc_driver_graphics fails
Merged tree
960: Mesh tests passed
1/3 Test #960: agc_driver_mesh ..................   Passed    1.42 sec
935: AGC driver submit tests passed
2/3 Test #935: agc_driver .......................   Passed    4.81 sec
958: Graphics validation tests passed
3/3 Test #958: agc_driver_graphics ..............   Passed    6.34 sec
100% tests passed out of 3
main
1/3 Test #960: agc_driver_mesh ..................   Passed    1.58 sec
2/3 Test #935: agc_driver .......................   Passed    4.79 sec
3/3 Test #958: agc_driver_graphics ..............   Passed    6.04 sec
100% tests passed out of 3
Negative controls
# 1: main's State.cpp, PR tests
958: AGC graphics: unexpected failure: AGC graphics: VGT_SHADER_STAGES_EN=0x482030: fast launch other than one point per subgroup is unsupported
1/3 Test #958: agc_driver_graphics ..............***Failed    0.18 sec
935: a registered fast-launch program resolved with a triangle strip was not prepared as for a point list
2/3 Test #935: agc_driver .......................***Failed    0.89 sec
3/3 Test #960: agc_driver_mesh ..................   Passed    1.42 sec
33% tests passed, 2 tests failed out of 3

# 2: main's State.cpp, decode loop over {21u} only
1/1 Test #958: agc_driver_graphics ..............***Failed    0.26 sec
AGC graphics: unexpected failure: AGC graphics: VGT_SHADER_STAGES_EN=0x482030: fast launch other than one point per subgroup is unsupported

The full-loop control fails on type 2 before it reaches 21. So I also ran the loop with type 21 alone, which confirms that the new case covers behaviour of its own and does not just pass because the earlier types pass.

Previous findings

  1. state.topology still follows VGT_PRIMITIVE_TYPE for fast launch, so the provoking-vertex and strip-interpolation checks can give the wrong cause. Still open, non-blocking. c65b4eff5f does not touch it (Pipeline.cpp:236 on current main still checks state.topology). The author agrees and plans a follow-up with a test for each check. They also say that neither message appears in their 17 CONTROL Resonant logs (author-reported). Both checks throw rather than draw anything wrong, so a follow-up is reasonable, and I am not holding this PR for it.
  2. Type 21 accepted but untested. Resolved by c65b4eff5f (tests/Graphics.cpp:1187). It passes on the merged tree and fails alone against main's State.cpp (negative control 2).

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • Whether the console starts one subgroup per vertex for a line or triangle VGT_PRIMITIVE_TYPE under fast launch. This is unchanged from my last review and is recorded in the debt entry as an assumption.
  • The CONTROL Resonant (PPSA34547) runs and the author's RADV run of c65b4eff5f. Both are author-reported; I launched no title.
  • AMD and Windows runs. I ran on NVIDIA under Linux only.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5698496833 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8395#pullrequestreview-5698496833). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T13:31:20Z. **Review:** APPROVED --- # Re-checked — approved The only new commit, c65b4eff5f, adds `VGT_PRIMITIVE_TYPE` 21 to the fast-launch decode test, as my previous review suggested. The merge with current `main` is clean, the focused AGC tests pass with the Khronos validation layer and log no `VUID-` lines on either side, and the new type 21 case fails on its own against `main`'s `State.cpp`. ## What changed since my last review - One commit on top of f29635063c: c65b4eff5f, test only. It changes `{2u, 3u, 4u, 5u, 6u}` to `{2u, 3u, 4u, 5u, 6u, 21u}` in the decode loop ([tests/Graphics.cpp:1187](https://github.com/boykopovar/AnyPS5/blob/c65b4eff5f04f9587d9d220b8e87a654edff093c/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp#L1187-L1187)). Production code is the same as in the commit I approved. - The author replied to both findings, and the Tested section now mentions c65b4eff5f. - `main` moved from 899ae3d1ad to 478b5f1a93. ## What I ran - PR head: `c65b4eff5f04f9587d9d220b8e87a654edff093c` - `main`: `478b5f1a93c9bb1cb79e7578f4438a42d7381353` - Merged tree (`main` + head, `--no-ff`): `a69d18318712b1c2f42a9f7e5d9fa83b283874a4`, no conflicts - Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), in a clean worktree ```sh git fetch origin main pull/8395/head:refs/review/8395 git log --oneline f29635063c..refs/review/8395 && git diff f29635063c refs/review/8395 git checkout --detach origin/main && git merge --no-ff --no-edit refs/review/8395 git diff --check origin/main...refs/review/8395 python3 tools/check_conventions.py --base origin/main nice -n 10 cmake --build build -j10 --target libs agc_driver_tests agc_driver_graphics_tests agc_driver_mesh_tests VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ nice -n 10 ctest --test-dir build -R '^(agc_driver|agc_driver_graphics|agc_driver_mesh)$' -V --output-on-failure -j4 # the same build and ctest command on origin/main (478b5f1a93) in the same worktree # negative control 1: merged tree, git checkout origin/main -- core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp, rebuild, the same ctest command # negative control 2: as 1, with the decode loop narrowed to {21u}, then rebuild agc_driver_graphics_tests and run ctest -R '^agc_driver_graphics$' ``` | Check | Result | |---|---| | Merge with `main` | Clean | | `git diff --check` | Clean | | `tools/check_conventions.py --base origin/main` | `All conventions checks passed.` | | Build (`libs` and the three test targets), merged tree and `main` | OK | | `agc_driver`, `agc_driver_graphics`, `agc_driver_mesh`, merged tree, with validation | 3 of 3 pass (4.8 s, 6.3 s, 1.4 s) | | The same on `main` | 3 of 3 pass (4.8 s, 6.0 s, 1.6 s) | | `Insert instance layer "VK_LAYER_KHRONOS_validation"` | 3 on `main`, 3 on the merged tree | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | 0 on both | | `VUID-` lines | 0 on both | | Negative control 1 (`main`'s `State.cpp`) | `agc_driver` and `agc_driver_graphics` fail, `agc_driver_mesh` passes | | Negative control 2 (type 21 only, `main`'s `State.cpp`) | `agc_driver_graphics` fails | <details><summary>Merged tree</summary> ``` 960: Mesh tests passed 1/3 Test #960: agc_driver_mesh .................. Passed 1.42 sec 935: AGC driver submit tests passed 2/3 Test #935: agc_driver ....................... Passed 4.81 sec 958: Graphics validation tests passed 3/3 Test #958: agc_driver_graphics .............. Passed 6.34 sec 100% tests passed out of 3 ``` </details> <details><summary>main</summary> ``` 1/3 Test #960: agc_driver_mesh .................. Passed 1.58 sec 2/3 Test #935: agc_driver ....................... Passed 4.79 sec 3/3 Test #958: agc_driver_graphics .............. Passed 6.04 sec 100% tests passed out of 3 ``` </details> <details><summary>Negative controls</summary> ``` # 1: main's State.cpp, PR tests 958: AGC graphics: unexpected failure: AGC graphics: VGT_SHADER_STAGES_EN=0x482030: fast launch other than one point per subgroup is unsupported 1/3 Test #958: agc_driver_graphics ..............***Failed 0.18 sec 935: a registered fast-launch program resolved with a triangle strip was not prepared as for a point list 2/3 Test #935: agc_driver .......................***Failed 0.89 sec 3/3 Test #960: agc_driver_mesh .................. Passed 1.42 sec 33% tests passed, 2 tests failed out of 3 # 2: main's State.cpp, decode loop over {21u} only 1/1 Test #958: agc_driver_graphics ..............***Failed 0.26 sec AGC graphics: unexpected failure: AGC graphics: VGT_SHADER_STAGES_EN=0x482030: fast launch other than one point per subgroup is unsupported ``` </details> The full-loop control fails on type 2 before it reaches 21. So I also ran the loop with type 21 alone, which confirms that the new case covers behaviour of its own and does not just pass because the earlier types pass. ## Previous findings 1. **`state.topology` still follows `VGT_PRIMITIVE_TYPE` for fast launch, so the provoking-vertex and strip-interpolation checks can give the wrong cause.** Still open, non-blocking. c65b4eff5f does not touch it ([Pipeline.cpp:236](https://github.com/boykopovar/AnyPS5/blob/478b5f1a93c9bb1cb79e7578f4438a42d7381353/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp#L236-L236) on current `main` still checks `state.topology`). The author agrees and plans a follow-up with a test for each check. They also say that neither message appears in their 17 CONTROL Resonant logs (author-reported). Both checks throw rather than draw anything wrong, so a follow-up is reasonable, and I am not holding this PR for it. 2. **Type 21 accepted but untested.** Resolved by c65b4eff5f ([tests/Graphics.cpp:1187](https://github.com/boykopovar/AnyPS5/blob/c65b4eff5f04f9587d9d220b8e87a654edff093c/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp#L1187-L1187)). It passes on the merged tree and fails alone against `main`'s `State.cpp` (negative control 2). ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - Whether the console starts one subgroup per vertex for a line or triangle `VGT_PRIMITIVE_TYPE` under fast launch. This is unchanged from my last review and is recorded in the debt entry as an assumption. - The CONTROL Resonant (PPSA34547) runs and the author's RADV run of c65b4eff5f. Both are author-reported; I launched no title. - AMD and Windows runs. I ran on NVIDIA under Linux only.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!8395
No description provided.