Skip to content

fix(agc): accept disabled conservative rasterization with uncertainty-region bits - #2226

Merged
adriadam10 merged 4 commits into
boykopovar:mainfrom
EdouardSence:fix/agc-conservative-uncertainty-disabled
Oct 10, 2026
Merged

adriadam10 merged 4 commits into
boykopovar:mainfrom
EdouardSence:fix/agc-conservative-uncertainty-disabled

Conversation

@EdouardSence

@EdouardSence EdouardSence commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #1915. Only the last commit, ab09a0a, is this PR; the first three are #1915's (its head af9e60b).

What

Ratchet & Clank: Rift Apart (PPSA01474) writes PA_SC_CONSERVATIVE_RASTERIZATION_CNTL = 0xe6000 on its first draws. Decoded with the field shifts in the kernel's gc_10_3_0_sh_mask.h:

Bits Field Value
0 OVER_RAST_ENABLE 0
5 UNDER_RAST_ENABLE 0
13, 14 OVERRIDE_{OVER,UNDER}_RAST_INNER_TO_NORMAL 1, 1
17:16 UNCERTAINTY_REGION_MODE 2
18, 19 OUTER_ / INNER_UNCERTAINTY_EDGERULE_OVERRIDE 1, 1

Both rasterization enables are clear, as in libSceAgc's 0x6000. On top of #1915's disabled mask (0x00106000), this also accepts bits 19:16, the uncertainty-region mode and its two edge-rule overrides:

I have no source that says these fields do nothing when both enables are clear. RADV never writes them; it sets PBB_UNCERTAINTY_REGION_ENABLE only for overestimation. So the TechnicalDebt entry records it as an assumption from the field names, not a measurement.

Tested

Linux (CachyOS, GCC), RX 9070 XT, RADV / Mesa 26.2.4.

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: fix(agc): accept RADV's disabled conservative rasterization and out-of-order watermark #1915
  • AI-assisted: yes. The investigation, code, tests and this description were written by Claude (Claude Code) on my machine.

🤖 Generated with Claude Code

TheAggie and others added 3 commits October 8, 2026 18:24
RADV sets OUT_OF_ORDER_WATER_MARK to 7 on every GFX10 draw, also when
OUT_OF_ORDER_PRIMITIVE_ENABLE is off. The watermark only tunes out-of-order
rasterization, which stays rejected, so the field is accepted alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With conservative rasterization disabled, RADV programs
PA_SC_CONSERVATIVE_RASTERIZATION_CNTL to NULL_SQUAD_AA_MASK_ENABLE alone,
where libSceAgc writes the two INNER_TO_NORMAL overrides (0x6000). A value
made of only those bits now decodes as disabled; overestimation (0x6001) keeps
its checks, and every other mode is still rejected.

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

With depth bias enabled, RADV sets POLY_OFFSET_PARA_ENABLE in
PA_SU_SC_MODE_CNTL next to the front and back enables, whatever the
topology; vkQuake's draws carry 0x3a46. The bit applies the offset to
points and lines, so it changes nothing for triangles, and Vulkan applies
depth bias only to polygons. It is now accepted with depth bias on
triangle topologies; point and line draws with it are still rejected.

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

rmz-24 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Windows run: Windows 11 Pro 25H2 (10.0.26200.9457), RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON, full build plus libs. 11cd1dc cherry-picked onto current main d70b899 (applies cleanly).

  • agc_driver_graphics passes on NVIDIA, in addition to the RADV run in the description.
  • Full ctest: 510/510.

AI-assisted: yes

…-region bits

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

Copy link
Copy Markdown
Collaborator

Checked on Linux, main + this head: agc_driver_graphics and agc_driver_prepared_graphics pass, and the new rows fail without the change. 0xe6000 decodes as disabled; 0xe6001 and 0xe6020 are still rejected. The mask change is applied in both DecodeState and DrawRejection, and the TechnicalDebt entry states the assumption honestly. Merging.

@adriadam10
adriadam10 merged commit 530b6a4 into boykopovar:main Oct 10, 2026
9 checks passed
SleglJan pushed a commit to SleglJan/AnyPS5 that referenced this pull request Oct 10, 2026
…tive-uncertainty-disabled

fix(agc): accept disabled conservative rasterization with uncertainty-region bits
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.

4 participants