fix(agc): decode line lists drawn by NGG vertex workgroups #26600

Merged
Jazeupoi merged 1 commit from upstream-pr/26600 into main 2026-11-29 12:30:05 +00:00
Jazeupoi commented 2026-11-24 09:39:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Jazeupoi on 2026-11-24T09:39:53Z.


What

A type-2 PRIMGEN vertex program that needs a workgroup (DS instructions or s_barrier) and draws a line list with VGT_GS_OUT_PRIM_TYPE = 1 threw "VGT_GS_OUT_PRIM_TYPE other than a triangle strip ... is unsupported". The mesh path already exports two-index lines for geometry programs; DecodeShaderStages now takes the output size from VGT_GS_OUT_PRIM_TYPE for a vertex workgroup too, instead of a fixed 3, when the input is a line list. This matches what RADV programs for line topologies (radv_conv_prim_to_gs_out maps line lists to LINESTRIP) and how Mesa's NGG lowering packs a line's two indices. Point output from a vertex workgroup, and line output with a non-line input, still throw.

NggVertexWorkgroupTests checks the line-list subgroup (64 lines, 128 vertices and primitives), the last provoking vertex, and that point output from a line list or a point list still throws. The NGG vertex workgroups debt entry is updated through a fragment.

Tested

Windows 11, NVIDIA GeForce RTX 2060, driver 621.24. agc_driver_graphics passes. It ran on an older local tree (00ede212a0) with this PR's State.cpp and test hunks applied, not on the branch itself. check_conventions.py passes on the branch.

PS5SX2 (PPSA99203) vk-285-321, "PS2 system menu" option: before this change it stops with the error above as soon as the option starts. With it, the start-up animation is drawn (its coloured trails are these lines), then the PlayStation and PS2 logos, and it reaches the "Select language" screen. That run also bypassed two other stops locally, so it doesn't show the title working on main:

  • the noautoprof flag file, for SIGPROF sent through pthread_kill with an SA_SIGINFO handler,
  • the "v_interp_mov p10 of a flat input with the first provoking vertex" check, see #1413.

It runs at 1 to 4 FPS there; I have not looked into speed.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: PPSA99203 #4850 (with #27327, #26653 and #27140, it reaches the BIOS "Select language" screen with no local workaround)
  • GPUs tested: NVIDIA GeForce RTX 2060, driver 621.24, Windows 11
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5469687711 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26600). Originally posted by [Jazeupoi](https://github.com/Jazeupoi) on 2026-11-24T09:39:53Z. --- ### What A type-2 PRIMGEN vertex program that needs a workgroup (DS instructions or `s_barrier`) and draws a line list with `VGT_GS_OUT_PRIM_TYPE = 1` threw "VGT_GS_OUT_PRIM_TYPE other than a triangle strip ... is unsupported". The mesh path already exports two-index lines for geometry programs; `DecodeShaderStages` now takes the output size from `VGT_GS_OUT_PRIM_TYPE` for a vertex workgroup too, instead of a fixed 3, when the input is a line list. This matches what RADV programs for line topologies (`radv_conv_prim_to_gs_out` maps line lists to `LINESTRIP`) and how Mesa's NGG lowering packs a line's two indices. Point output from a vertex workgroup, and line output with a non-line input, still throw. `NggVertexWorkgroupTests` checks the line-list subgroup (64 lines, 128 vertices and primitives), the last provoking vertex, and that point output from a line list or a point list still throws. The NGG vertex workgroups debt entry is updated through a fragment. ### Tested Windows 11, NVIDIA GeForce RTX 2060, driver 621.24. `agc_driver_graphics` passes. It ran on an older local tree (00ede212a0) with this PR's `State.cpp` and test hunks applied, not on the branch itself. `check_conventions.py` passes on the branch. PS5SX2 (PPSA99203) vk-285-321, "PS2 system menu" option: before this change it stops with the error above as soon as the option starts. With it, the start-up animation is drawn (its coloured trails are these lines), then the PlayStation and PS2 logos, and it reaches the "Select language" screen. That run also bypassed two other stops locally, so it doesn't show the title working on `main`: - the `noautoprof` flag file, for SIGPROF sent through `pthread_kill` with an SA_SIGINFO handler, - the "v_interp_mov p10 of a flat input with the first provoking vertex" check, see #1413. It runs at 1 to 4 FPS there; I have not looked into speed. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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) and the licence notice of code adapted from upstream (see AGENTS.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: PPSA99203 #4850 (with #27327, #26653 and #27140, it reaches the BIOS "Select language" screen with no local workaround) - [x] GPUs tested: NVIDIA GeForce RTX 2060, driver 621.24, Windows 11 - [x] AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-11-25 07:38:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T07:38:52Z.

Review: APPROVED


Reviewed — looks good

The line list workgroup path now derives its output size from the primitive type, and the reviewed state and test changes support merging.

What I ran

Reviewed head a88ecab6484d6196d8e6b40429d460c9e067fbd8. No commands or tests were run; repo_read.py was used to inspect the prepared review bundle and source at the pinned head. The author reports a graphics test run on an older local tree and a conventions check on the branch; neither was run by me.

Results

Check Result Note
Code review passed Changed logic and relevant test ranges inspected
Graphics tests not run Author reports a run on an older local tree
Conventions check not run Author reports a pass on the branch

Negative control

Not run. The added tests assert that point output from a line list and line output from a point list remain unsupported.

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

The full Graphics.cpp text was excluded from the review bundle for size; I read its relevant changed and surrounding ranges through repo_read.py. I read the full changed State.cpp range and debt note. I did not run tests, the conventions check, or a console run.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6053575175 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26600#pullrequestreview-6053575175). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T07:38:52Z. **Review:** APPROVED --- # Reviewed — looks good The line list workgroup path now derives its output size from the primitive type, and the reviewed state and test changes support merging. ## What I ran Reviewed head `a88ecab6484d6196d8e6b40429d460c9e067fbd8`. No commands or tests were run; `repo_read.py` was used to inspect the prepared review bundle and source at the pinned head. The author reports a graphics test run on an older local tree and a conventions check on the branch; neither was run by me. ## Results | Check | Result | Note | |---|---|---| | Code review | passed | Changed logic and relevant test ranges inspected | | Graphics tests | not run | Author reports a run on an older local tree | | Conventions check | not run | Author reports a pass on the branch | ## Negative control Not run. The added tests assert that point output from a line list and line output from a point list remain unsupported. ## Findings ### Blocking None. ### Non-blocking None. ## Sources - [State.cpp at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/a88ecab6484d6196d8e6b40429d460c9e067fbd8/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp) - [Graphics.cpp at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/a88ecab6484d6196d8e6b40429d460c9e067fbd8/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp) - [Debt change at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/a88ecab6484d6196d8e6b40429d460c9e067fbd8/docs/dev/debt/changes/fix-ngg-vertex-line-output.md) ## Not verified The full `Graphics.cpp` text was excluded from the review bundle for size; I read its relevant changed and surrounding ranges through `repo_read.py`. I read the full changed `State.cpp` range and debt note. I did not run tests, the conventions check, or a console run. ## To get this to a good state Nothing is required.
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!26600
No description provided.