fix(agc): support one-pixel vertex point lists #9412

Closed
Antifrag wants to merge 1 commit from upstream-pr/9412 into main
Antifrag commented 2026-10-21 21:07:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Antifrag on 2026-10-21T21:07:33Z.


What

Mafia: Definitive Edition (PPSA36458) aborts while entering its main menu with AGC graphics: point-list vertex rendering requires point-size output support. Allow vertex-path point lists when PA_SU_POINT_SIZE requests one-pixel points and PA_SU_POINT_MINMAX includes that size. Require VK_KHR_maintenance5, which defines a default point size of 1.0 when the shader does not write PointSize.

This is an intentionally minimal alternative to #6639, which implements register and per-vertex point sizes. It also overlaps #6801 at the point-list checks. Please choose one approach; these are overlapping alternatives, not dependencies. This version adds no shader request fields, shader ABI changes or pipeline-journal format changes. Larger points, per-vertex sizes and point-sprite texture-coordinate replacement remain explicit failures, documented in technical debt. The draw register key includes the point size, limits and sprite-control registers so cached decoding cannot bypass those checks.

Add state-decoding coverage for supported sizes, unsupported sizes and limits, missing registers, sprite replacement and the device-feature guard. Extend the GPU polygon-mode test to draw a vertex point list and verify the exact three output pixels.

Tested

Windows 11, WinLibs MinGW-w64 GCC 15.2.0, Release. NVIDIA GeForce RTX 4070 Laptop GPU, NVIDIA driver 617.42.

Compared current main 0c6a5bd5938fde7bbc0bf720927c4584bd3e4700 with this change 6fb20a01f on the same machine and GPU. Both runs passed all three focused tests: agc_driver_graphics, agc_driver_polygon_mode_draw, and agc_driver_inactive_vertex_point_size.

ANYPS5_REQUIRE_VULKAN=1
ANYPS5_NO_SHADER_CACHE=1
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation
ctest --test-dir build-winlibs -R '^(agc_driver_graphics|agc_driver_polygon_mode_draw|agc_driver_inactive_vertex_point_size)$' -V

main:   100% tests passed, 0 tests failed out of 3
change: 100% tests passed, 0 tests failed out of 3

Both verbose logs confirm insertion of VK_LAYER_KHRONOS_validation; neither contains was not found but was requested by env var VK_INSTANCE_LAYERS. Main: zero VUID- errors. Change: zero VUID- errors, so no new validation errors. The layer was loaded from a local LunarG SDK extraction via VK_LAYER_PATH.

Local title run: after dismissing the 2K connection-failure dialog, Mafia reaches the rendered main menu and stays running until the diagnostic run's 180-second time cap. The contributor subsequently confirmed starting a new game. Performance remains poor: the contributor reports approximately 9-14 FPS in the opening cinematic and 1.2 FPS in gameplay. These are unprofiled observations, not a benchmark or a speedup claim; this PR addresses the startup abort.

No matching Game bring-up discussion for PPSA36458 was found, so the formal Unblocks item below is none.

python tools/check_conventions.py --base origin/main passes. The overlap report confirms #6639 and #6801 and reports a draw-key overlap with #6977 and constructor-anchor conflicts with #8564, #9020 and #9335; some other PRs cannot be compared because they already conflict with main. These line overlaps are not dependencies.

Checklist

  • Based on current main; no other open PR implements the same functions (explicit exception: this is a deliberately overlapping minimal alternative to #6639 and #6801, disclosed above)
  • 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: none
  • GPUs tested: NVIDIA GeForce RTX 4070 Laptop GPU, NVIDIA 617.42, Windows 11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4958374942 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9412). Originally posted by [Antifrag](https://github.com/Antifrag) on 2026-10-21T21:07:33Z. --- ### What Mafia: Definitive Edition (PPSA36458) aborts while entering its main menu with `AGC graphics: point-list vertex rendering requires point-size output support`. Allow vertex-path point lists when `PA_SU_POINT_SIZE` requests one-pixel points and `PA_SU_POINT_MINMAX` includes that size. Require `VK_KHR_maintenance5`, which defines a default point size of 1.0 when the shader does not write [PointSize](https://docs.vulkan.org/refpages/latest/refpages/source/PointSize.html). This is an intentionally minimal alternative to #6639, which implements register and per-vertex point sizes. It also overlaps #6801 at the point-list checks. Please choose one approach; these are overlapping alternatives, not dependencies. This version adds no shader request fields, shader ABI changes or pipeline-journal format changes. Larger points, per-vertex sizes and point-sprite texture-coordinate replacement remain explicit failures, documented in technical debt. The draw register key includes the point size, limits and sprite-control registers so cached decoding cannot bypass those checks. Add state-decoding coverage for supported sizes, unsupported sizes and limits, missing registers, sprite replacement and the device-feature guard. Extend the GPU polygon-mode test to draw a vertex point list and verify the exact three output pixels. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11, WinLibs MinGW-w64 GCC 15.2.0, Release. NVIDIA GeForce RTX 4070 Laptop GPU, NVIDIA driver 617.42. Compared current main `0c6a5bd5938fde7bbc0bf720927c4584bd3e4700` with this change `6fb20a01f` on the same machine and GPU. Both runs passed all three focused tests: `agc_driver_graphics`, `agc_driver_polygon_mode_draw`, and `agc_driver_inactive_vertex_point_size`. ```text ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build-winlibs -R '^(agc_driver_graphics|agc_driver_polygon_mode_draw|agc_driver_inactive_vertex_point_size)$' -V main: 100% tests passed, 0 tests failed out of 3 change: 100% tests passed, 0 tests failed out of 3 ``` Both verbose logs confirm insertion of `VK_LAYER_KHRONOS_validation`; neither contains `was not found but was requested by env var VK_INSTANCE_LAYERS`. Main: zero `VUID-` errors. Change: zero `VUID-` errors, so no new validation errors. The layer was loaded from a local LunarG SDK extraction via `VK_LAYER_PATH`. Local title run: after dismissing the 2K connection-failure dialog, Mafia reaches the rendered main menu and stays running until the diagnostic run's 180-second time cap. The contributor subsequently confirmed starting a new game. Performance remains poor: the contributor reports approximately 9-14 FPS in the opening cinematic and 1.2 FPS in gameplay. These are unprofiled observations, not a benchmark or a speedup claim; this PR addresses the startup abort. No matching Game bring-up discussion for PPSA36458 was found, so the formal Unblocks item below is `none`. `python tools/check_conventions.py --base origin/main` passes. The overlap report confirms #6639 and #6801 and reports a draw-key overlap with #6977 and constructor-anchor conflicts with #8564, #9020 and #9335; some other PRs cannot be compared because they already conflict with main. These line overlaps are not dependencies. ### 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 (explicit exception: this is a deliberately overlapping minimal alternative to #6639 and #6801, disclosed above) - [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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: NVIDIA GeForce RTX 4070 Laptop GPU, NVIDIA 617.42, Windows 11 <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
wachi35676 commented 2026-10-21 22:59:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-21T22:59:26Z.


Windows check of head 6fb20a01 merged onto main a6dcea927 (clean merge, 87e6a93dd), adding an AMD run to the RTX 4070 run in the description.

Host: Windows 11 (10.0.26300), Ryzen 5 9600X, WinLibs GCC 15.2.0, Release. GPUs: NVIDIA RTX 5070 Ti (617.42) and AMD Radeon RDNA2 iGPU 1002:13c0 (proprietary 32.0.21042.62, ANYPS5_GPU=AMD). ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, no validation layer.

  • On both GPUs agc_driver_graphics, agc_driver_polygon_mode_draw (with the new vertex point-list draw, exactly three corner pixels) and agc_driver_inactive_vertex_point_size pass. The pipeline was accepted, so both devices report maintenance5, and with no PointSize write both drew 1-pixel points.
  • 81-test related agc set: the results match main on both GPUs. The only failures are main's existing local ones (image_array_window_past_layer_limit does not build under MinGW; agc_driver_tessellation fails on AMD).
  • Negative control: I kept the tests and reverted Graphics/ to main. agc_driver_graphics then fails on both GPUs with point-list vertex rendering requires point-size output support. agc_driver_polygon_mode_draw still passes on main. That test builds State directly and never goes through DecodeState, so it covers rasterization of 1-pixel points but not the decode change. The decode change is covered only by the mock test.
  • I checked the register use against Mesa's src/amd/registers/gfx10.json. PA_SU_POINT_SIZE 0x28a00 (context 0x280) is HEIGHT[15:0]/WIDTH[31:16]. PA_SU_POINT_MINMAX 0x28a04 is MIN[15:0]/MAX[31:16]. SPI_PS_INPUT_CNTL_n has PT_SPRITE_TEX at bit 17 and PT_SPRITE_TEX_ATTR1 at bit 23. SPI_INTERP_CONTROL_0 (0x1b5) has PNT_SPRITE_ENA at bit 1, and SPI_PS_IN_CONTROL (0x1b6) has NUM_INTERP[5:0]. The R6xx 3D register reference describes the size fields as "1/2 Height (Vertical Radius) of point; fixed (12.4)", so 0x00080008 is a 1-pixel point, as the PR assumes.
  • tools/check_conventions.py --base a6dcea927 passes.

AI-assisted: yes (Claude Code); results above were run on this machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6328442067 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9412#issuecomment-6328442067). Originally posted by [wachi35676](https://github.com/wachi35676) on 2026-10-21T22:59:26Z. --- Windows check of head `6fb20a01` merged onto main `a6dcea927` (clean merge, `87e6a93dd`), adding an AMD run to the RTX 4070 run in the description. Host: Windows 11 (10.0.26300), Ryzen 5 9600X, WinLibs GCC 15.2.0, Release. GPUs: NVIDIA RTX 5070 Ti (617.42) and AMD Radeon RDNA2 iGPU `1002:13c0` (proprietary 32.0.21042.62, `ANYPS5_GPU=AMD`). `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`, no validation layer. - On both GPUs `agc_driver_graphics`, `agc_driver_polygon_mode_draw` (with the new vertex point-list draw, exactly three corner pixels) and `agc_driver_inactive_vertex_point_size` pass. The pipeline was accepted, so both devices report `maintenance5`, and with no `PointSize` write both drew 1-pixel points. - 81-test related agc set: the results match main on both GPUs. The only failures are main's existing local ones (`image_array_window_past_layer_limit` does not build under MinGW; `agc_driver_tessellation` fails on AMD). - Negative control: I kept the tests and reverted `Graphics/` to main. `agc_driver_graphics` then fails on both GPUs with `point-list vertex rendering requires point-size output support`. `agc_driver_polygon_mode_draw` still passes on main. That test builds `State` directly and never goes through `DecodeState`, so it covers rasterization of 1-pixel points but not the decode change. The decode change is covered only by the mock test. - I checked the register use against Mesa's `src/amd/registers/gfx10.json`. `PA_SU_POINT_SIZE` 0x28a00 (context 0x280) is HEIGHT[15:0]/WIDTH[31:16]. `PA_SU_POINT_MINMAX` 0x28a04 is MIN[15:0]/MAX[31:16]. `SPI_PS_INPUT_CNTL_n` has PT_SPRITE_TEX at bit 17 and PT_SPRITE_TEX_ATTR1 at bit 23. `SPI_INTERP_CONTROL_0` (0x1b5) has PNT_SPRITE_ENA at bit 1, and `SPI_PS_IN_CONTROL` (0x1b6) has NUM_INTERP[5:0]. The R6xx 3D register reference describes the size fields as "1/2 Height (Vertical Radius) of point; fixed (12.4)", so `0x00080008` is a 1-pixel point, as the PR assumes. - `tools/check_conventions.py --base a6dcea927` passes. AI-assisted: yes (Claude Code); results above were run on this machine.
MarcZX10 commented 2026-10-22 05:08:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T05:08:23Z.

Review: CHANGES_REQUESTED


The report includes useful same-GPU validation and a clear one-pixel scope, but I found a path-classification issue that needs correction before this is ready. The guard below treats every non-mesh point-list pipeline as a vertex pipeline; the current shader-stage model also has geometry and tessellation paths. Please restrict this behavior to the vertex path (or implement and test the relevant downstream point-size behavior), with a regression that exercises a non-vertex point-list path.

The branch is based on 0c6a5bd5938f and is 423 commits behind current main (da54c652e30b); the checklist's current-main claim is stale. Please rebase, rerun conventions/overlap checks, and rerun the paired focused AGC validation against current main and this head. The existing Windows/NVIDIA test report is valuable, but it is on the older base.

The overlap report also identifies direct alternatives #6639 and #6801 in the same point-list state logic. This PR acknowledges that they are alternatives, but the contribution rules require author coordination on which goes first and recording the resulting order in Depends on. Please resolve that with the affected authors and refresh the overlap report after rebasing. I did not find a matching local AGC build or Vulkan device here, so I did not independently run the GPU tests. The hosted product jobs were skipped; policy checks passed.

AI assistance was used to prepare this review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5609516588 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9412#pullrequestreview-5609516588). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T05:08:23Z. **Review:** CHANGES_REQUESTED --- The report includes useful same-GPU validation and a clear one-pixel scope, but I found a path-classification issue that needs correction before this is ready. The guard below treats every non-mesh point-list pipeline as a vertex pipeline; the current shader-stage model also has geometry and tessellation paths. Please restrict this behavior to the vertex path (or implement and test the relevant downstream point-size behavior), with a regression that exercises a non-vertex point-list path. The branch is based on `0c6a5bd5938f` and is 423 commits behind current `main` (`da54c652e30b`); the checklist's current-main claim is stale. Please rebase, rerun conventions/overlap checks, and rerun the paired focused AGC validation against current `main` and this head. The existing Windows/NVIDIA test report is valuable, but it is on the older base. The overlap report also identifies direct alternatives #6639 and #6801 in the same point-list state logic. This PR acknowledges that they are alternatives, but the contribution rules require author coordination on which goes first and recording the resulting order in `Depends on`. Please resolve that with the affected authors and refresh the overlap report after rebasing. I did not find a matching local AGC build or Vulkan device here, so I did not independently run the GPU tests. The hosted product jobs were skipped; policy checks passed. AI assistance was used to prepare this review.

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