Skip to content

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

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
TheAggie:feat/agc-pixel-stipple-fixed-point
Oct 10, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
TheAggie:feat/agc-pixel-stipple-fixed-point

Conversation

@TheAggie

@TheAggie TheAggie commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

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 feat(agc): accept graphics programs without an AGC shader header #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, feat(agc): accept graphics programs without an AGC shader header #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

@johnmaia

johnmaia commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adriadam10

Copy link
Copy Markdown
Collaborator

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.

@adriadam10
adriadam10 force-pushed the feat/agc-pixel-stipple-fixed-point branch from 1ee43ea to c160d31 Compare October 10, 2026 08:27
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 10, 2026
@adriadam10
adriadam10 merged commit 444edc3 into boykopovar:main Oct 10, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants