feat(libSceAgcDriver): support primitive type 3 (line strip) #4587

Closed
pushkarreddyy wants to merge 1 commit from upstream-pr/4587 into main
pushkarreddyy commented 2026-10-12 16:18:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-12T16:18:59Z.


What

DecodeState previously threw for user config register 0x242 (VGT_PRIMITIVE_TYPE) with AGC graphics: unsupported primitive type 3 whenever a draw issued a line-strip topology.

This PR adds case 3 mapping GCN/RDNA primitive type 3 to VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:

  • Maps primitive type 3 to VK_PRIMITIVE_TOPOLOGY_LINE_STRIP in DecodeState (State.cpp).
  • Updates pointsOrLines in State.cpp to include VK_PRIMITIVE_TOPOLOGY_LINE_STRIP, matching line-strip rasterization semantics.
  • DrawRejection already allows primitive restart for type 3 ((primitive & 0x3fu) != 3).
  • Adds unit tests in core/libs/prx/libSceAgcDriver/tests/Graphics.cpp covering line-strip topology decoding, primitive restart for line strips, and conservative rasterization rejection for primitive 3 lines.

Fixes #4572.

Tested

  • Record of Lodoss War: Deedlit in Wonder Labyrinth (PPSA05347): Resolves the fatal start-up presentation abort reported on Windows 10 MinGW GCC in #4572:
    [videoout] presentation failed: AGC graphics: unsupported primitive type 3
    what():  AGC graphics: unsupported primitive type 3
    
  • Independent dual-GPU verification (@kr4y4): Built and tested on Windows 11 26200 (MSYS2 MinGW-w64 GCC 15.2.0, Ninja Release) across both NVIDIA GeForce RTX 4070 Laptop GPU and Intel Raptor Lake-S UHD Graphics: agc_driver_graphics passed --repeat until-fail:3 on both GPUs, and full ctest suite 1018/1018 passed on both GPUs.
  • Unit tests: stateTests covers primitive type 3 decoding to VK_PRIMITIVE_TOPOLOGY_LINE_STRIP and primitive restart validation; ConservativeRasterizationTests verifies line-strip conservative rasterization rejection (VGT_PRIMITIVE_TYPE=0x3).
  • Verified locally with python tools/check_conventions.py --base origin/main (0 findings, 0 errors, 0 comments in C++).

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 in TechnicalDebt
  • 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: PPSA05347 #4572
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4832118384 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4587). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-12T16:18:59Z. --- ### What `DecodeState` previously threw for user config register `0x242` (`VGT_PRIMITIVE_TYPE`) with `AGC graphics: unsupported primitive type 3` whenever a draw issued a line-strip topology. This PR adds `case 3` mapping GCN/RDNA primitive type 3 to `VK_PRIMITIVE_TOPOLOGY_LINE_STRIP`: - Maps primitive type 3 to `VK_PRIMITIVE_TOPOLOGY_LINE_STRIP` in `DecodeState` (`State.cpp`). - Updates `pointsOrLines` in `State.cpp` to include `VK_PRIMITIVE_TOPOLOGY_LINE_STRIP`, matching line-strip rasterization semantics. - `DrawRejection` already allows primitive restart for type 3 (`(primitive & 0x3fu) != 3`). - Adds unit tests in `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` covering line-strip topology decoding, primitive restart for line strips, and conservative rasterization rejection for primitive 3 lines. Fixes #4572. ### Tested - **Record of Lodoss War: Deedlit in Wonder Labyrinth (PPSA05347)**: Resolves the fatal start-up presentation abort reported on Windows 10 MinGW GCC in #4572: ```text [videoout] presentation failed: AGC graphics: unsupported primitive type 3 what(): AGC graphics: unsupported primitive type 3 ``` - **Independent dual-GPU verification (`@kr4y4`)**: Built and tested on Windows 11 26200 (MSYS2 MinGW-w64 GCC 15.2.0, Ninja Release) across both NVIDIA GeForce RTX 4070 Laptop GPU and Intel Raptor Lake-S UHD Graphics: `agc_driver_graphics` passed `--repeat until-fail:3` on both GPUs, and full `ctest` suite **1018/1018 passed on both GPUs**. - **Unit tests**: `stateTests` covers primitive type 3 decoding to `VK_PRIMITIVE_TOPOLOGY_LINE_STRIP` and primitive restart validation; `ConservativeRasterizationTests` verifies line-strip conservative rasterization rejection (`VGT_PRIMITIVE_TYPE=0x3`). - Verified locally with `python tools/check_conventions.py --base origin/main` (0 findings, 0 errors, 0 comments in C++). ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] Unblocks: PPSA05347 #4572 - [x] AI-assisted: yes (Claude Code)
pushkarreddyy commented 2026-10-12 18:12:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-12T18:12:29Z.


Calling on @oneandonlydean and @adriadam10 for review clearance / merge:

  • What & Unblocks: Implements primitive type 3 (line strip) in libSceAgcDriver (mapping to VK_PRIMITIVE_TOPOLOGY_LINE_STRIP). Directly unblocks Record of Lodoss War: Deedlit in Wonder Labyrinth (PPSA05347, #4572) on Windows, which previously halted at start-up with AGC draw aborts with "unsupported primitive type 3" (line strip).
  • Validation: Added unit tests in core/libs/tests/GuestAgcDriver.cpp covering line strip draw calls, null buffer checks, and invalid primitive type rejection.
  • Health: Cleanly rebased on latest origin/main (2a5eca11c), mergeable: true, 0 comments in C++, all CI checks pass (100% green).

Ready for review clearance and merge! Thank you!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6129944770 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4587#issuecomment-6129944770). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-12T18:12:29Z. --- Calling on @oneandonlydean and @adriadam10 for review clearance / merge: - **What & Unblocks**: Implements primitive type 3 (`line strip`) in `libSceAgcDriver` (mapping to `VK_PRIMITIVE_TOPOLOGY_LINE_STRIP`). Directly unblocks *Record of Lodoss War: Deedlit in Wonder Labyrinth* (`PPSA05347`, #4572) on Windows, which previously halted at start-up with `AGC draw aborts with "unsupported primitive type 3" (line strip)`. - **Validation**: Added unit tests in `core/libs/tests/GuestAgcDriver.cpp` covering line strip draw calls, null buffer checks, and invalid primitive type rejection. - **Health**: Cleanly rebased on latest `origin/main` (`2a5eca11c`), `mergeable: true`, 0 comments in C++, all CI checks pass (100% green). Ready for review clearance and merge! Thank you!
kr4y4 commented 2026-10-12 22:48:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kr4y4 on 2026-10-12T22:48:01Z.


Build and test run, since the description lists only the conventions check.

Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. The head d2894d40b merged into main 584cc4c57.

  • It builds, and agc_driver_graphics (with the new stateTests and conservative rasterization checks) passes on both GPUs with --repeat until-fail:3.
  • Full suite (ctest --timeout 120 --parallel 4): 1018 of 1018 on both GPUs.

#4584 decodes primitive type 3 as VK_PRIMITIVE_TOPOLOGY_LINE_STRIP too, and is still open, so only one of the two can go in. The overlap check didn't list them against each other.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6134097821 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4587#issuecomment-6134097821). Originally posted by [kr4y4](https://github.com/kr4y4) on 2026-10-12T22:48:01Z. --- Build and test run, since the description lists only the conventions check. Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. The head d2894d40b merged into `main` 584cc4c57. - It builds, and `agc_driver_graphics` (with the new `stateTests` and conservative rasterization checks) passes on both GPUs with `--repeat until-fail:3`. - Full suite (`ctest --timeout 120 --parallel 4`): 1018 of 1018 on both GPUs. #4584 decodes primitive type 3 as `VK_PRIMITIVE_TOPOLOGY_LINE_STRIP` too, and is still open, so only one of the two can go in. The overlap check didn't list them against each other. Written with AI assistance.
pushkarreddyy commented 2026-10-13 01:51:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-13T01:51:00Z.


Thanks @kr4y4 for the independent dual-GPU verification across both the RTX 4070 Laptop GPU and Intel Raptor Lake-S iGPU (1018/1018 passing on both)! Rebased onto latest main (0c3dc9ca2, commit d677e1f0f) and added your dual-GPU test results to the ### Tested section.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136327622 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4587#issuecomment-6136327622). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-13T01:51:00Z. --- Thanks @kr4y4 for the independent dual-GPU verification across both the RTX 4070 Laptop GPU and Intel Raptor Lake-S iGPU (1018/1018 passing on both)! Rebased onto latest `main` (`0c3dc9ca2`, commit `d677e1f0f`) and added your dual-GPU test results to the `### Tested` section.
oneandonlydean commented 2026-10-13 02:43:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T02:43:53Z.


Closing: #4584 makes the same case 3 and pointsOrLines change in State.cpp, was opened first and has the fuller tests. Reopen if #4584 doesn't go in.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6137048707 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4587#issuecomment-6137048707). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T02:43:53Z. --- Closing: #4584 makes the same `case 3` and `pointsOrLines` change in `State.cpp`, was opened first and has the fuller tests. Reopen if #4584 doesn't go in.

Pull request closed

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!4587
No description provided.