Skip to content

fix(agc): accept inactive vertex point size on non-point draws - #4715

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Lorkydey:fix/agc-inactive-vertex-point-size
Oct 14, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Lorkydey:fix/agc-inactive-vertex-point-size

Conversation

@Lorkydey

@Lorkydey Lorkydey commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What

XashPS5 (PPSA19111, v1.3 / content version 01.030.000; bring-up #4711) reaches presentation on main 1acfa7f and stops at:

clip distances, layer, viewport or auxiliary vertex exports is unsupported (register 0x207 = 0x01210000)

The rejected bit is PA_CL_VS_OUT_CNTL.USE_VTX_POINT_SIZE (bit 16). The captured draw uses triangles (VGT_PRIMITIVE_TYPE=4), VGT_SHADER_STAGES_EN=0x02012010 and PA_SU_SC_MODE_CNTL=0x00083a40. Point size is inactive for this filled triangle draw.

Accept the bit for supported non-point primitives with GS_EN and HS_EN clear, when polygon mode is disabled or both faces are filled. The draw precheck and state decoder use the same rule. Points, patches, absent routing/raster registers and potentially active polygon point modes remain rejected; clip/cull, edge and kill checks are preserved.

The register interpretation follows AMD CIK, PA_CL_VS_OUT_CNTL bit 16 and Vulkan PointSize. This inference is recorded in the existing library debt file; console hardware semantics have not been measured.

With this change alone at 6d5ee52, XashPS5 passes that check and stops later at:

shader 0x200220200 stage 1: ShaderRecompiler::Recompile: unsupported dynamic s_setpc_b64 at program counter 0x0000003c

The menu and gameplay remain unreachable. This removes one observed presentation blocker.

Tested

  • Windows: Windows 11 Pro 26100, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, GTX 1660 SUPER (driver 32.0.15.5585). Full libs, relinker and focused test targets build at exact head d4b59ce9fa89b54ab5a0e9ed34f902892d2e4f02, based on main 075169f7b3faeae1216efc35df41c44fac9f3190 including merged fix(agc): render all attachment layers with dynamic rendering #3763. Local ANYPS5_ENABLE_SPIRV_TOOLS=OFF. All 11 selected tests pass with Vulkan required.

  • Positive checks: Coverage includes shader memory, graphics state, clip/cull distances and both clip/cull pixel variants, layered-volume draw/submit/vertex variants and layer exports. The inactive-point-size pixel regression passes. State tests retain line-strip/primitive-restart and continuation-independent clip/cull coverage. A new combined state case enables inactive point size on a valid layered draw and verifies that layer routing and paClVsOutCntl remain unchanged.

  • Negative control, Windows and Linux: keeping the pixel test and replacing only State.cpp with main 075169f7b fails at the export check for 0x01210000. Restoring the exact PR source and rebuilding recovers the positive results above. The pixel test compares every output byte with the inactive bit off/on while the shader exports point size 1024.0; the reference has partial triangle coverage.

  • Linux: public validation of this exact source passes on Ubuntu 24.04 with GCC, Release, default SPIRV-Tools enabled and lavapipe with Vulkan required. It builds full libs/relinker and the focused targets, runs the same 11 selected tests (10 passed, 1 skipped, zero failures), checks conventions/registration, verifies the negative controls and restores/retests the exact PR source. agc_driver_vertex_clip_cull_distances is skipped by the Linux test; it passes on the Windows GPU above. The workflow is separate from the source branch.

  • Conventions, registration and patch whitespace pass locally. These are focused checks, not the full suite. The earlier Windows XashPS5 title run at 6d5ee52b7 with owned Half-Life 1 data reached the later vertex-tail stop in 7.38 s; no fresh title run is claimed for this rebase.

Dependencies and overlap

#423 (clip/cull exports), #4584 (line-strip decoding) and #3763 (layered rendering) are merged and included in the tested main baseline. Their implementations are preserved: both export-validation masks, clip/cull count limits, paClVsOutCntl, layer routing and line-strip topology/primitive restart remain covered.

The former #3763 overlap is resolved against its merged implementation. The state decoder retains main's removal of the obsolete unconditional layer-export diagnostic and adds the inactive-point-size allowance alongside the layer and clip/cull export masks. The new combined state regression and the layered-rendering tests above pass. None of these merged PRs remains an outstanding dependency.

Checklist

Comment thread core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
@Lorkydey
Lorkydey force-pushed the fix/agc-inactive-vertex-point-size branch from 6d5ee52 to 93f1a1a Compare October 12, 2026 20:09
@github-actions github-actions Bot added docs agc libSceAgc* labels Oct 12, 2026
@MarcZX10

Copy link
Copy Markdown
Contributor

Thanks, I checked the updated helper and tests. Primitive 3 is now covered as a line strip, including the indexed primitive-restart precheck, while the tests keep the potentially active point-size cases rejected. The reported convention check is also green.

@xXPBSXx

xXPBSXx commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Windows test (MinGW GCC 15.2, Release, Windows 10, RTX 4080 SUPER). Built in a batch with five other open GPU PRs cherry-picked onto main 44ab0c39e (not current main, which needs a submodule that isn't checked out here), so only the tests that belong to this PR say anything about it:

  • tests/execution/InactiveVertexPointSize.cpp (agc_driver_inactive_vertex_point_size): 3 of 3 runs passed.
  • tests/Graphics.cpp (agc_driver_graphics): see below.

agc_driver_graphics over the batch: 9 of 10 runs passed. The one failure is the known address-layout flake from #4660 as far as I can tell: I kept only the first lines of that run's log (the host import ... vkAllocateMemory (-2) lines, which appear in passing runs as well), not its final error message, so I can't confirm the cause for that one run. Plain main failed 2 of 10 on the same machine earlier.

Not tested: no game run; the batch was not rebuilt per PR, so a failure would have needed a bisect (there was none besides the flake).

AI-assisted (Claude Code).

@Lorkydey

Copy link
Copy Markdown
Contributor Author

@eljackjoestar-cmd @MichonGoddijn231849 Coordinating the newly flagged overlap with #3763.

A pairwise merge simulation of #4715 (93f1a1a95) and #3763 (53dae55dc) conflicts only in Graphics/src/State.cpp. #3763 carries the clip/cull handling from its #423 dependency, while this PR adds the conditional inactive-point-size allowance.

The eventual resolution needs both ClipCullExports and inactiveVertexPointSize(queue) in the decode and rejection masks, while retaining the clip/cull count limit, paClVsOutCntl propagation and rejection of potentially active point size. The state tests that currently reject clip/cull bits will also need updating after #423.

The existing proposed prerequisites here remain #423 and #4584. I propose this PR next, before #3763 (subject to its own prerequisites). Does that work for you? If #3763 is ready first, I can instead record that order and rebase this PR after it. I will rerun the state and pixel regressions after integration; no combined build or runtime validation with #3763 is claimed here.

AI-assisted: yes (Codex).

@eljackjoestar-cmd

Copy link
Copy Markdown
Contributor

Yes, #4715 before #3763 works, after #423 and #4584 land. I’ll record #4715 as a merge-order dependency for #3763 and rebase afterward.
The resolution will retain both masks, the clip/cull count limit, paClVsOutCntl propagation and rejection of potentially active point size. I’ll rerun the relevant state and rendering tests after integration.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 13, 2026
@Lorkydey
Lorkydey force-pushed the fix/agc-inactive-vertex-point-size branch from 93f1a1a to 6507943 Compare October 13, 2026 09:38
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 13, 2026
@Lorkydey
Lorkydey force-pushed the fix/agc-inactive-vertex-point-size branch from 6507943 to d4b59ce Compare October 13, 2026 11:19
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 13, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on the PR merged onto main: AgcDriver-scoped build and ctest pass (agc_driver_graphics, agc_driver_inactive_vertex_point_size, prepared graphics variants); the only failure is agc_driver_tessellation, which segfaults on main as well. Both new tests fail without the State.cpp change. The stage and raster masks match GS_EN/HS_EN and the polygon-mode fields, and clip/cull limits and the point/patch rejections are preserved. Merging once the full Build is green.

RINNECODER added a commit to RINNECODER/AnyPS5 that referenced this pull request Oct 13, 2026
* perf(agc): fast-skip pure PM4 NOP packets during queue execution

(cherry picked from commit 139bf04)

Ported from upstream PR boykopovar#5481

* fix(agc): copy a shader, context or user config register to memory with COPY_DATA

A dispatch now leaves its initiator and, for DISPATCH_DIRECT, its group
counts in the shader registers, where the CP puts them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 5e36c08)

Ported from upstream PR boykopovar#5477

* fix(agc): accept reported vertex stage state

(cherry picked from commit 632331d)

Ported from upstream PR boykopovar#4341

* fix(agc): initialize stencil control and reference masks

(cherry picked from commit 85e0d98bba896002539365bb29a7a39a8e43f501)
(cherry picked from commit 13dca48)

Ported from upstream PR boykopovar#5347

* fix(agc): accept inactive vertex point size on non-point draws

(cherry picked from commit d4b59ce)

Ported from upstream PR boykopovar#4715

* fix(agc): treat type-0 texture descriptors as null

(cherry picked from commit 7e1e1ce)

Ported from upstream PR boykopovar#4779

* fix(agc): fall back out-of-range sceAgcInit versions to table 13

Pointer-shaped NID kW3GLb7QfPg calls from public homebrew succeed on console; returning an error left those titles failing init after boykopovar#4835.

(cherry picked from commit 939f784)

Ported from upstream PR boykopovar#5163 (debt-doc hunk dropped: file absent on main)

* fix(agc): clamp sceAgcInit versions above 13 inline

(cherry picked from commit 0cc5102)

Ported from upstream PR boykopovar#5163 (second commit)

* metal: adapt the shared AGC driver slice to the Metal execution loop

- skip pure PM4 NOP packets in the Metal packet loop (upstream PR boykopovar#5481)
- note the dispatch registers after direct and indirect Metal dispatch so
  COPY_DATA from a shader register works there (upstream PR boykopovar#5477)
- NullImageDescriptor delegates to IsNullTextureResource (upstream PR boykopovar#4779)
- tests: pm4 compute replay reads the dispatch initiator and group counts
  back through COPY_DATA; metal utility tests cover a type-0 image descriptor

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj

---------

Co-authored-by: Kikoarl <7354010+Kikoarl@users.noreply.github.com>
Co-authored-by: LeandroLP23 <leandroplacidi@gmail.com>
Co-authored-by: MarcZX100 <marczxrr@gmail.com>
Co-authored-by: MathiasDevelopes <25400788+MathiasDevelopes@users.noreply.github.com>
Co-authored-by: lorkydey <57268822+Lorkydey@users.noreply.github.com>
Co-authored-by: mazen <mazenshaar@hotmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#5496 docs/dev/debt/libSceAgcDriver.md L4
#5524 docs/dev/debt/libSceAgcDriver.md L4
#5554 docs/dev/debt/libSceAgcDriver.md L4
#5631 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp L103

@oneandonlydean
oneandonlydean merged commit 803cbf2 into boykopovar:main Oct 14, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants