feat(agc): accept the LINE_STIPPLE_TEX and POS_FIXED_PT pixel inputs #1819

Merged
TheAggie merged 1 commit from upstream-pr/1819 into main 2026-10-10 08:37:00 +00:00
TheAggie commented 2026-10-08 20:21:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-08T20:21:47Z.


What

DecodePixelStageInfo rejected any SPI_PS_INPUT_ENA/ADDR with LINE_STIPPLE_TEX_ENA (bit 7) or POS_FIXED_PT_ENA (bit 15): unsupported SPI_PS_INPUT_ENA/ADDR bit combination. RADV on the PS5 (mihawk-99/PS5_Mesa) sets both. In Mesa's radv_compute_spi_ps_input (src/amd/vulkan/radv_shader.c):

  • LINE_STIPPLE_TEX is the required pixel input of a shader that reads no interpolants: "At least one of PERSP_* (0xF) or LINEAR_* (0x70) or LINE_STIPPLE_TEX must be enabled. LINE_STIPPLE_TEX uses the least number of initialized VGPRs". ccleste's (PPSA59322) present shader is one; with #1732 on current main, every frame stopped there (presentation failed).
  • POS_FIXED_PT is enabled when a shader reads integer pixel coordinates (reads_pixel_coord): X in bits 15:0, Y in bits 31:16.

Changes:

  • Both bits join the supported inputs in DecodePixelStageInfo. PERSP_PULL_MODEL and SAMPLE_COVERAGE are still rejected.
  • ShaderInputInfoBuilder places both VGPRs whenever SPI_PS_INPUT_ADDR has the bit. inputAddr is already part of every cache, draw and request key, so no key or serializer changes are needed.
  • The pixel entry fills them:
    • POS_FIXED_PT is uint(FragCoord.x) | uint(FragCoord.y) << 16.
    • LINE_STIPPLE_TEX is 0, because line stipple is not emulated. The TechnicalDebt entry under Functional records this.
  • Tests:
    • agc_driver_graphics (PixelInputLayoutTests):
      • ENA/ADDR 0x80 decodes, with LINE_STIPPLE_TEX in v0.
      • With 0x8082, LINE_STIPPLE_TEX takes v2 and POS_FIXED_PT v3, after the perspective-center pair.
      • A shader exporting the POS_FIXED_PT VGPR reads FragCoord, and one exporting LINE_STIPPLE_TEX does not.
      • 0x8 and 0x4000 are still rejected.
    • New GPU test agc_driver_pixel_fixed_point_position:
      • A pixel shader splits the POS_FIXED_PT VGPR into X and Y and converts them to float. It exports them with the LINE_STIPPLE_TEX VGPR into a linear 64x16 32_32_32_32 float target.
      • Every pixel must read back (x, y, 0, 1) for three ADDR layouts: the input alone, after LINE_STIPPLE_TEX, and after the perspective-center pair and LINE_STIPPLE_TEX.
      • It fails (pixel (1, 0) holds (0, 0, 0, 1)) without the POS_FIXED_PT emission.

Tested

Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, NVIDIA GeForce RTX 5070 Ti; the new GPU test also on lavapipe (Mesa 25.2.8, Windows).

  • The full suite (478 tests) passes on this branch. It was run from the generated CTestTestfile.cmake commands because antivirus blocks ctest.exe on this machine.
  • ccleste renders its title screen on current main with this, #1732 and my other pending changes on a local branch (RADV_DEBUG=nonggc set).

Not tested on AMD, Intel or Linux hardware.

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
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4792344747 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1819). Originally posted by [TheAggie](https://github.com/TheAggie) on 2026-10-08T20:21:47Z. --- ### What `DecodePixelStageInfo` rejected any `SPI_PS_INPUT_ENA`/`ADDR` with `LINE_STIPPLE_TEX_ENA` (bit 7) or `POS_FIXED_PT_ENA` (bit 15): `unsupported SPI_PS_INPUT_ENA/ADDR bit combination`. RADV on the PS5 ([mihawk-99/PS5_Mesa](https://github.com/mihawk-99/PS5_Mesa)) sets both. In Mesa's `radv_compute_spi_ps_input` (`src/amd/vulkan/radv_shader.c`): - `LINE_STIPPLE_TEX` is the required pixel input of a shader that reads no interpolants: "At least one of PERSP_* (0xF) or LINEAR_* (0x70) or LINE_STIPPLE_TEX must be enabled. LINE_STIPPLE_TEX uses the least number of initialized VGPRs". ccleste's (PPSA59322) present shader is one; with #1732 on current `main`, every frame stopped there (`presentation failed`). - `POS_FIXED_PT` is enabled when a shader reads integer pixel coordinates (`reads_pixel_coord`): X in bits 15:0, Y in bits 31:16. Changes: - Both bits join the supported inputs in `DecodePixelStageInfo`. `PERSP_PULL_MODEL` and `SAMPLE_COVERAGE` are still rejected. - `ShaderInputInfoBuilder` places both VGPRs whenever `SPI_PS_INPUT_ADDR` has the bit. `inputAddr` is already part of every cache, draw and request key, so no key or serializer changes are needed. - The pixel entry fills them: - `POS_FIXED_PT` is `uint(FragCoord.x) | uint(FragCoord.y) << 16`. - `LINE_STIPPLE_TEX` is 0, because line stipple is not emulated. The TechnicalDebt entry under Functional records this. - Tests: - `agc_driver_graphics` (`PixelInputLayoutTests`): - ENA/ADDR 0x80 decodes, with `LINE_STIPPLE_TEX` in v0. - With 0x8082, `LINE_STIPPLE_TEX` takes v2 and `POS_FIXED_PT` v3, after the perspective-center pair. - A shader exporting the `POS_FIXED_PT` VGPR reads `FragCoord`, and one exporting `LINE_STIPPLE_TEX` does not. - 0x8 and 0x4000 are still rejected. - New GPU test `agc_driver_pixel_fixed_point_position`: - A pixel shader splits the `POS_FIXED_PT` VGPR into X and Y and converts them to float. It exports them with the `LINE_STIPPLE_TEX` VGPR into a linear 64x16 `32_32_32_32` float target. - Every pixel must read back `(x, y, 0, 1)` for three ADDR layouts: the input alone, after `LINE_STIPPLE_TEX`, and after the perspective-center pair and `LINE_STIPPLE_TEX`. - It fails (`pixel (1, 0) holds (0, 0, 0, 1)`) without the `POS_FIXED_PT` emission. ### Tested Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, NVIDIA GeForce RTX 5070 Ti; the new GPU test also on lavapipe (Mesa 25.2.8, Windows). - The full suite (478 tests) passes on this branch. It was run from the generated `CTestTestfile.cmake` commands because antivirus blocks `ctest.exe` on this machine. - ccleste renders its title screen on current `main` with this, #1732 and my other pending changes on a local branch (`RADV_DEBUG=nonggc` set). Not tested on AMD, Intel or Linux hardware. ### 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] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
johnmaia commented 2026-10-09 01:01:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-09T01:01:40Z.


Linux run on AMD, since the description lists it as not tested: Ubuntu 24.04.5 (kernel 6.8), GCC 13.3, Release, AMD Radeon RX 7600 (RADV NAVI33, Mesa 25.2.8). This PR's head bda16f01, merged onto main f1451396. Full ctest: 495/495 pass, with the GPU tests running on the RX 7600 (none skipped). That includes the new agc_driver_pixel_fixed_point_position and agc_driver_graphics with this PR's cases.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6072106548 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1819#issuecomment-6072106548). Originally posted by [johnmaia](https://github.com/johnmaia) on 2026-10-09T01:01:40Z. --- Linux run on AMD, since the description lists it as not tested: Ubuntu 24.04.5 (kernel 6.8), GCC 13.3, Release, AMD Radeon RX 7600 (RADV NAVI33, Mesa 25.2.8). This PR's head `bda16f01`, merged onto `main` `f1451396`. Full ctest: 495/495 pass, with the GPU tests running on the RX 7600 (none skipped). That includes the new `agc_driver_pixel_fixed_point_position` and `agc_driver_graphics` with this PR's cases.
adriadam10 commented 2026-10-10 08:27:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T08:27:36Z.


Checked on current main: the PR rebased cleanly except for the TechnicalDebt line, which I moved off the end of the section to avoid the append conflict. Build and ctest of libSceAgc/libSceAgcDriver are green; agc_driver_graphics and agc_driver_pixel_fixed_point_position fail without the change. Also confirmed by @johnmaia on an RX 7600 (RADV). Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095673819 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1819#issuecomment-6095673819). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T08:27:36Z. --- Checked on current `main`: the PR rebased cleanly except for the TechnicalDebt line, which I moved off the end of the section to avoid the append conflict. Build and ctest of libSceAgc/libSceAgcDriver are green; `agc_driver_graphics` and `agc_driver_pixel_fixed_point_position` fail without the change. Also confirmed by @johnmaia on an RX 7600 (RADV). Merging once CI is green.
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!1819
No description provided.