Skip to content

docs(agc): note that addrlib and fpPS4 take the 2D PRT modes from the whole coordinates - #13691

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
xXPBSXx:docs-agc-ps4-prt-2d-tiling
Oct 31, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
xXPBSXx:docs-agc-ps4-prt-2d-tiling

Conversation

@xXPBSXx

@xXPBSXx xXPBSXx commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What

The PS4 (GCN) tiling entry said that pipe and bank of every PRT mode come from the coordinates inside the macro tile. The pipe bits lie inside the macro tile in every mode, so only the bank differs: for GB_TILE_MODE 11 and 16 all three sources I read take the bank from the coordinates inside the macro tile, while for the four 2D PRT modes (6, 7, 12 and 17) AMD's addrlib and fpPS4 take it from the whole coordinates and shadPS4 and this code take it inside the macro tile. The entry now says so for 11 and 16, and a new entry names the difference. The entries then read:

  • PS4 (GCN) tiling (libSceAgcDriver, PS4) - not checked on a console. Surfaces with GuestTextureResource::gcnPitch set use the GB_TILE_MODE and GB_MACROTILE_MODE tables of shadPS4 and addrlib's ComputeSurfaceAddrFromCoordMicroTiled and MacroTiled: 8x8 micro tiles in thin, depth or display element order, macro tiles with pipe config P8_32x32_16x16 (P8_32x32_8x16 for the two PRT thin modes), bank width 1 and a 256-byte pipe interleave, depth micro tiles split into slices a whole surface apart with the bank rotated by (banks / 2 + 1) per slice, PRT pipe, and for GB_TILE_MODE 11 and 16 bank, taken from the coordinates inside the macro tile, and LINEAR_GENERAL rows of exactly the pitch. TextureTiling.cpp compares it with a separate implementation of them.
  • PS4 (GCN) 2D PRT tiling (libSceAgcDriver, PS4) - not checked on a console. GB_TILE_MODE 6, 7, 12 and 17 take the bank from the coordinates inside the macro tile, as shadPS4 does; AMD's addrlib (Mesa 393bf0d1467c) and fpPS4 (04cefd43e6fd) use the whole coordinates for the bank of these 2D PRT modes and take it inside the macro tile only for modes 11 and 16, which fpPS4 documents as the ones that can alias virtual pages to one physical page.

Changed: docs/dev/debt/libSceAgcDriver.md, one existing entry and one new one. No code change.

Method: the three were read at the linked commits; only their behaviour is described, no code was taken over. AMD addrlib (Mesa) egbaddrlib.cpp L1775-L1780 reduces x and y modulo the macro tile only for the PRT modes without rotation, which its mode flags mark for PRT_TILED_THIN1 only (not PRT_2D_TILED_THIN1 or PRT_3D_TILED_THIN1); fpPS4 ps4_tiling.pas L2812-L2816 does the same for its two non-2D PRT array modes and documents the 2D ones as not aliasing virtual pages; shadPS4 tiling.comp L392-L396 reduces all PRT modes. In this code GcnTiling (TextureTiling.cpp) does so for all six PRT modes, which GuestTextureResource.cpp maps from GB_TILE_MODE 6, 7, 11, 12, 16 and 17. PS4 only (surfaces with gcnPitch); not measured on a console, and no title that uses these modes has been run.

Overlap

Open PRs that change docs/dev/debt/libSceAgcDriver.md (file sets from git diff --name-only against each PR head's merge base, all 1585 open pull requests as of 2026-10-30 22:00 UTC, main 9605300f29): 134 touch the file or are ours. One gives a new conflict with this change: #9674 rewrites the thick and layered surfaces entry, which sits on the line directly below the new entry, so whichever merges second needs a one-line rebase; the texts do not overlap. #9891, #9892 and #9895 conflict with main itself and give the same result with and without this commit. The others give the same merge result with and without it. Our other PRs (#12742, #12765, #12797) have no conflict with it. Checked again on 2026-10-30 at 23:49 UTC against main ac551a129a (1565 open pull requests): this head merges cleanly, #9674 is still the only new conflict, and of the 28 pull requests opened since 21:55 UTC, #13667 and #13678 change the file and merge with and without this commit.

Tested

Documentation only. tools/check_conventions.py --base upstream/main passes; the changed entry is 990 characters and the new one 518; based on main 9605300f29, and it merges with main b44985a3ea without a conflict (checked 2026-10-30 22:56 UTC). Not built, not run.

Checklist

AI-assisted (Claude Code).

🤖 Generated with Claude Code

… whole coordinates

The PS4 tiling entry said pipe and bank of every PRT mode come from the coordinates inside the macro tile. It now says so for GB_TILE_MODE 11 and 16, and a new entry names the four 2D PRT modes (6, 7, 12, 17), where this code follows shadPS4 and AMD's addrlib and fpPS4 use the whole coordinates. Nothing is claimed about the console.

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

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — changes requested

The PR records an overlap with #9674 in the same debt file but leaves Depends on: none without recording an agreed landing order, contrary to the repository's overlap rule.

What I ran

Reviewed head f33d726734bf568270668ef24a184efc5a81bcde against PR base f25279c0ca4cb068370df4baaa46de7b4f4741c7. The stack check previewed it cleanly against current main 93c71cc1bbe43b5e9e9d33fdded98e77efacbdba; the changed file overlaps #9674, whose current head is not included. Environment: Debian Linux x86-64, Python 3.11.2. This PR changes documentation only; no build or tests were run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13691
python3 tools/pr_stack_check.py 13691 --repo boykopovar/AnyPS5 --output-dir /tmp/pr13691-stack
gh pr checks 13691 --repo boykopovar/AnyPS5

Results

Check Result
Patch and conventions Passed; git diff --check passed and repository conventions passed.
Current-main merge preview Clean as an individual PR.
Overlap coordination The stack report identifies #9674 as an overlapping dependency candidate in docs/dev/debt/libSceAgcDriver.md; its head is not included in #13691. The PR description also says the second landing will need a rebase, but does not record an agreed order.
Hosted CI Conventions, labels, eligibility, and intake passed. Build and specialized jobs were skipped.
Tests Not applicable to this documentation-only diff.
Precheck helper The isolated checkout lacked the workspace-only test-quality script; no tests changed, so that heuristic does not apply.
Unedited outputs
All conventions checks passed.
# PR stack check — fresh

Target: https://github.com/boykopovar/AnyPS5/pull/13691
Target branch tip: `93c71cc1bbe43b5e9e9d33fdded98e77efacbdba`
All heads unchanged: **True**
Dependency order: #9674 → #13691

## Individual merge previews

- PR #9674: **clean** against current base; head `297118f83bccf69aeef9fbe54a51a15d4feaef81`; changed paths: none reported
- PR #13691: **clean** against current base; head `f33d726734bf568270668ef24a184efc5a81bcde`; changed paths: none reported

## Dependency relationships

- #9674 → #13691: **current_dependency_head_not_included**; overlapping changed paths: `docs/dev/debt/libSceAgcDriver.md`
conventions	pass	17s	https://github.com/boykopovar/AnyPS5/actions/runs/41148281893/job/124378428284
labels	pass	7s	https://github.com/boykopovar/AnyPS5/actions/runs/41148282004/job/124378428820
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41148282088/job/124378823026
windows	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41148282088/job/124378823407
eligibility	pass	6s	https://github.com/boykopovar/AnyPS5/actions/runs/41148282088/job/124378427938
intake	pass	4s	https://github.com/boykopovar/AnyPS5/actions/runs/41148281972/job/124378428351

Findings

Blocking

The repository requires authors of overlapping PRs to agree on landing order and declare that order with Depends on. This PR's overlap section identifies #9674 as changing the adjacent entry in the same file and says one of the PRs will need a rebase, while the checklist still says Depends on: none; I found no recorded agreement from #9674's author. Please coordinate the order with that author, record the agreement, and update the checklist to match (including Depends on: #9674 if that PR must land first).

Non-blocking

The new debt entry links to shadPS4's moving main branch, while the PR's explanation cites a pinned commit. Pin the debt-entry link too when convenient so the stated comparison remains reproducible.

Sources

Not verified

I did not build or run tests because the change is documentation only. I did not independently reproduce the cited Mesa addrlib analysis; the source comparison in the PR description remains author-provided evidence.

To get this to a good state

Please record the agreed #9674/#13691 order and update the checklist accordingly. I will rerun the overlap and convention checks on the updated head.

@github-actions

github-actions Bot commented Oct 31, 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
PR 9891 docs/dev/debt/libSceAgcDriver.md L106-107

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6280 docs/dev/debt/libSceAgcDriver.md
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6804 docs/dev/debt/libSceAgcDriver.md
PR 6808 docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6977 docs/dev/debt/libSceAgcDriver.md
PR 7048 docs/dev/debt/libSceAgcDriver.md
PR 7256 docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7844 docs/dev/debt/libSceAgcDriver.md
PR 7978 docs/dev/debt/libSceAgcDriver.md
PR 8014 docs/dev/debt/libSceAgcDriver.md
PR 8319 docs/dev/debt/libSceAgcDriver.md
PR 8542 docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 9356 docs/dev/debt/libSceAgcDriver.md
PR 9387 docs/dev/debt/libSceAgcDriver.md
PR 9432 docs/dev/debt/libSceAgcDriver.md
PR 9592 docs/dev/debt/libSceAgcDriver.md
PR 9915 docs/dev/debt/libSceAgcDriver.md
PR 9950 docs/dev/debt/libSceAgcDriver.md
PR 10026 docs/dev/debt/libSceAgcDriver.md
PR 10233 docs/dev/debt/libSceAgcDriver.md
PR 10256 docs/dev/debt/libSceAgcDriver.md
PR 10469 docs/dev/debt/libSceAgcDriver.md
PR 10492 docs/dev/debt/libSceAgcDriver.md
PR 10497 docs/dev/debt/libSceAgcDriver.md
PR 10940 docs/dev/debt/libSceAgcDriver.md
PR 11126 docs/dev/debt/libSceAgcDriver.md
PR 12120 docs/dev/debt/libSceAgcDriver.md
PR 13146 docs/dev/debt/libSceAgcDriver.md

@xXPBSXx

xXPBSXx commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. The checklist of this PR already declares the order: the line reads Depends on: #9674 (landing order only; adjacent lines), so this PR lands after #9674, and the overlap section says why: both change entries on adjacent lines of the same debt file, so whichever lands second needs a one-line rebase of its own entry. I had not recorded an agreement from #9674's author; I have now asked there (#9674 (comment)) and will update this PR once they answer.

On the non-blocking point: the shadPS4 link on main is in the existing PS4 (GCN) tiling entry, which this PR only edits; it is 990 characters, so a pinned link would take it over the 1000-character limit. I would pin it in a separate change that shortens the entry.

AI-assisted (Claude Code).

@github-actions github-actions Bot added the docs label Oct 31, 2026
@adriadam10 adriadam10 self-assigned this Oct 31, 2026
@adriadam10
adriadam10 merged commit e30f385 into boykopovar:main Oct 31, 2026
12 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the claims against Mesa addrlib 393bf0d (egbaddrlib.cpp PRT reduction limited to the no-rotation PRT modes), fpPS4 04cefd4 and GcnTiling in TextureTiling.cpp (all six PRT modes reduce inside the macro tile); the entries match. The two entries do not overlap #9674's text, the head merges cleanly and Conventions is green; merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants