docs(agc): correct five stale statements in the HTILE and multisampled target entries #9077

Merged
thuanquang merged 1 commit from upstream-pr/9077 into main 2026-10-24 09:54:35 +00:00
thuanquang commented 2026-10-21 11:53:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-21T11:53:55Z.


What

Five sentences in docs/dev/debt/libSceAgcDriver.md describe code that has since changed. Each is replaced with what main does now; nothing else in the entries changes.

  • HTILE depth fast clears: "The address match is exact, so a clear of a different HTILE range does not hit." #5111 (8fec47a4b) replaced the exact address comparisons with HtileFillCovers (DepthSurface.cpp:2417-2420 on main), which accepts any cleared range that contains the surface's HTILE start and reaches HtileMetadataBytes past it; takeClearedHtile (:1565-1572) uses it. Now: "A clear hits a surface only when its range covers that surface's whole HTILE, which need not start where the clear does."
  • HTILE depth fast clears: "HTILE initialization, the stencil-only update, and fast clears made by the SDK's own paths, CP DMA fills or other kernels are not covered and leave the depth image as it was." Since #5627 (4ddff7c6e), a bind reads HTILE that was written since it was last read, whoever wrote it, and takes a whole-surface depth or stencil fast clear; the next entry, [HTILE written by other kernels], describes this and its limits (some tiles cleared, multisampled targets, native depth guards). Now: "Fast clears that other writers leave in HTILE are taken at bind as the next entry describes."
  • Multisampled CMASK state: "one with 0xffffffff marks it expanded". Since #6669 (12b20e17f), MultisampledCmaskKeys (MultisampleTarget.cpp:901-907) returns the expanded key for the codes 0xcc, 0xdd, 0xee and 0xff, and NoteFill (:909-926) takes a whole-CMASK fill whose pattern repeats one of them. Now: "one with 0xcccccccc, 0xdddddddd, 0xeeeeeeee or 0xffffffff marks it expanded".
  • Multisampled texture no draw rendered to: "tile modes other than Standard4KB, Standard64KB and RenderTarget" throw. Since #6297 (69afb0569), createFilled (MultisampleTarget.cpp:819-826) also maps kZ64KBX and kD64KBX; only the default case refuses. Now: "tile modes other than Standard4KB, Standard64KB, Z64KBX, D64KBX and RenderTarget".
  • Multisampled target guest access: the guarded memory "uses fragment-aware 64 KiB render-target blocks." Since #6297, guard (MultisampleTarget.cpp:736-746) takes the fragment-aware size for every 64 KiB mode that MultisampledBlockLog2 (:35-41) knows except Standard64KB, so Z64KBX and D64KBX as well as RenderTarget. Now: "uses fragment-aware 64 KiB blocks for the RenderTarget, Z64KBX and D64KBX tile modes."

The Storage image write-back entry also links a file that no longer exists (Draw/DrawPipeline.hpp; the file is DrawPipeline.cpp). It is left out here because open #7912 rewrites that line.

Overlap: #7803 and #7948, which add entries right next to the edited lines, have both merged; this branch is rebased on top of them, and neither changed these sentences.

Tested

Docs only; nothing was built or run. Each statement was checked by reading the code cited above on main d34da5d694, and the commits were found with git log -S on the changed lines. Rebased onto main 990f45e17d (#7803 added the 'Sample 0 of a multisampled color target' entry right after the 'Multisampled texture no draw rendered to' entry; it stays as main has it) and rechecked there: the five statements still hold, at DepthSurface.cpp:2415-2418 (HtileFillCovers) and :1563-1570 (takeClearedHtile), MultisampleTarget.cpp:901-907 (MultisampledCmaskKeys) and the fill check at :919, the tile-mode mapping at :819-826, and guard at :736-746 with MultisampledBlockLog2 at :35-41; the 'HTILE written by other kernels' entry is still the next entry. Of the 96 other open pull requests that edit this file (checked on 990f45e17d), only #9700 (EQAA color targets) edits one of these entries: it changes other sentences of the Multisampled target guest access entry and keeps the one corrected here, so the two do not conflict in content, but they edit the same line and whichever merges second rebases it. Rebased onto main e78acf4bda for the conflict with #8283 (merged) in docs/dev/debt/libSceAgcDriver.md: main's text is kept and this PR's change is unchanged; the statements were rechecked on that commit.

  • python tools/check_conventions.py --base origin/main with this title and body: 0 errors and two debt-length warnings, for entries that were already over 1000 characters: HTILE depth fast clears (2008 characters before, 1967 after) and Multisampled target guest access (1831 before, 1868 after). Multisampled CMASK state stays under 1000 (958 to 996).
  • Not tested: behaviour on any machine; this changes text only.

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4951106537 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9077). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-21T11:53:55Z. --- ### What Five sentences in `docs/dev/debt/libSceAgcDriver.md` describe code that has since changed. Each is replaced with what `main` does now; nothing else in the entries changes. - **HTILE depth fast clears**: "The address match is exact, so a clear of a different HTILE range does not hit." #5111 (8fec47a4b) replaced the exact address comparisons with `HtileFillCovers` (`DepthSurface.cpp:2417-2420` on `main`), which accepts any cleared range that contains the surface's HTILE start and reaches `HtileMetadataBytes` past it; `takeClearedHtile` (`:1565-1572`) uses it. Now: "A clear hits a surface only when its range covers that surface's whole HTILE, which need not start where the clear does." - **HTILE depth fast clears**: "HTILE initialization, the stencil-only update, and fast clears made by the SDK's own paths, CP DMA fills or other kernels are not covered and leave the depth image as it was." Since #5627 (4ddff7c6e), a bind reads HTILE that was written since it was last read, whoever wrote it, and takes a whole-surface depth or stencil fast clear; the next entry, [HTILE written by other kernels], describes this and its limits (some tiles cleared, multisampled targets, native depth guards). Now: "Fast clears that other writers leave in HTILE are taken at bind as the next entry describes." - **Multisampled CMASK state**: "one with 0xffffffff marks it expanded". Since #6669 (12b20e17f), `MultisampledCmaskKeys` (`MultisampleTarget.cpp:901-907`) returns the expanded key for the codes 0xcc, 0xdd, 0xee and 0xff, and `NoteFill` (`:909-926`) takes a whole-CMASK fill whose pattern repeats one of them. Now: "one with 0xcccccccc, 0xdddddddd, 0xeeeeeeee or 0xffffffff marks it expanded". - **Multisampled texture no draw rendered to**: "tile modes other than Standard4KB, Standard64KB and RenderTarget" throw. Since #6297 (69afb0569), `createFilled` (`MultisampleTarget.cpp:819-826`) also maps `kZ64KBX` and `kD64KBX`; only the default case refuses. Now: "tile modes other than Standard4KB, Standard64KB, Z64KBX, D64KBX and RenderTarget". - **Multisampled target guest access**: the guarded memory "uses fragment-aware 64 KiB render-target blocks." Since #6297, `guard` (`MultisampleTarget.cpp:736-746`) takes the fragment-aware size for every 64 KiB mode that `MultisampledBlockLog2` (`:35-41`) knows except Standard64KB, so Z64KBX and D64KBX as well as RenderTarget. Now: "uses fragment-aware 64 KiB blocks for the RenderTarget, Z64KBX and D64KBX tile modes." The `Storage image write-back` entry also links a file that no longer exists (`Draw/DrawPipeline.hpp`; the file is `DrawPipeline.cpp`). It is left out here because open #7912 rewrites that line. Overlap: #7803 and #7948, which add entries right next to the edited lines, have both merged; this branch is rebased on top of them, and neither changed these sentences. ### Tested Docs only; nothing was built or run. Each statement was checked by reading the code cited above on `main` `d34da5d694`, and the commits were found with `git log -S` on the changed lines. Rebased onto `main` `990f45e17d` (#7803 added the 'Sample 0 of a multisampled color target' entry right after the 'Multisampled texture no draw rendered to' entry; it stays as `main` has it) and rechecked there: the five statements still hold, at `DepthSurface.cpp:2415-2418` (`HtileFillCovers`) and `:1563-1570` (`takeClearedHtile`), `MultisampleTarget.cpp:901-907` (`MultisampledCmaskKeys`) and the fill check at `:919`, the tile-mode mapping at `:819-826`, and `guard` at `:736-746` with `MultisampledBlockLog2` at `:35-41`; the 'HTILE written by other kernels' entry is still the next entry. Of the 96 other open pull requests that edit this file (checked on `990f45e17d`), only #9700 (EQAA color targets) edits one of these entries: it changes other sentences of the Multisampled target guest access entry and keeps the one corrected here, so the two do not conflict in content, but they edit the same line and whichever merges second rebases it. Rebased onto `main` `e78acf4bda` for the conflict with #8283 (merged) in `docs/dev/debt/libSceAgcDriver.md`: main's text is kept and this PR's change is unchanged; the statements were rechecked on that commit. - `python tools/check_conventions.py --base origin/main` with this title and body: 0 errors and two `debt-length` warnings, for entries that were already over 1000 characters: HTILE depth fast clears (2008 characters before, 1967 after) and Multisampled target guest access (1831 before, 1868 after). Multisampled CMASK state stays under 1000 (958 to 996). - Not tested: behaviour on any machine; this changes text only. ### 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
harisibrar1 commented 2026-10-21 14:08:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-21T14:08:36Z.

Review: APPROVED


Checked against main:

  • HTILE address match: HtileFillCovers (DepthSurface.cpp:2119-2122) accepts any range containing the HTILE start and reaching HtileMetadataBytes past it, and takeClearedHtile (:1375-1384) uses it, so "covers that surface's whole HTILE, which need not start where the clear does" is right.
  • HTILE other writers: DepthSurfaceView calls storeBackClearedHtile (:1720-1721), which reads HTILE written since the last read (htileReads, :1503-1535) and takes the fast clear. The pointer to the next entry is accurate.
  • CMASK fill codes: MultisampledCmaskKeys (MultisampleTarget.cpp:739-744) returns a key only for 0 and for tiles 0xc to 0xf with equal nibbles, and NoteFill (:747-764) needs the 32-bit pattern to repeat that byte, so 0xcccccccc, 0xdddddddd, 0xeeeeeeee and 0xffffffff are exactly right.
  • Tile modes: createFilled (:658-663) maps Standard4KB, Standard64KB, Z64KBX, D64KBX and R64KBX; guard (:578-580) uses fragment-aware blocks for the 64 KiB modes except Standard64KB (MultisampledBlockLog2, :32-38). Both rewordings match.
  • check_conventions.py --base main --head pr-9077: 0 errors; the two debt-length warnings are on entries already over the limit, and the HTILE one gets shorter.
  • Optional nit: the sentence before the first change still says the clear applies to "the surface with that DB_HTILE_DATA_BASE address", which now reads slightly against "need not start where the clear does".

Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5601044023 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9077#pullrequestreview-5601044023). Originally posted by [harisibrar1](https://github.com/harisibrar1) on 2026-10-21T14:08:36Z. **Review:** APPROVED --- Checked against main: - HTILE address match: `HtileFillCovers` (DepthSurface.cpp:2119-2122) accepts any range containing the HTILE start and reaching `HtileMetadataBytes` past it, and `takeClearedHtile` (:1375-1384) uses it, so "covers that surface's whole HTILE, which need not start where the clear does" is right. - HTILE other writers: `DepthSurfaceView` calls `storeBackClearedHtile` (:1720-1721), which reads HTILE written since the last read (`htileReads`, :1503-1535) and takes the fast clear. The pointer to the next entry is accurate. - CMASK fill codes: `MultisampledCmaskKeys` (MultisampleTarget.cpp:739-744) returns a key only for 0 and for tiles 0xc to 0xf with equal nibbles, and `NoteFill` (:747-764) needs the 32-bit pattern to repeat that byte, so 0xcccccccc, 0xdddddddd, 0xeeeeeeee and 0xffffffff are exactly right. - Tile modes: `createFilled` (:658-663) maps Standard4KB, Standard64KB, Z64KBX, D64KBX and R64KBX; `guard` (:578-580) uses fragment-aware blocks for the 64 KiB modes except Standard64KB (`MultisampledBlockLog2`, :32-38). Both rewordings match. - `check_conventions.py --base main --head pr-9077`: 0 errors; the two debt-length warnings are on entries already over the limit, and the HTILE one gets shorter. - Optional nit: the sentence before the first change still says the clear applies to "the surface with that `DB_HTILE_DATA_BASE` address", which now reads slightly against "need not start where the clear does". Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
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!9077
No description provided.