docs(agc): say that only a whole-plane storage write retires a depth surface #8423

Merged
thuanquang merged 1 commit from upstream-pr/8423 into main 2026-10-24 09:23:43 +00:00
thuanquang commented 2026-10-20 12:30:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-20T12:30:05Z.


What

The depth surface entry in docs/dev/debt/libSceAgcDriver.md says a depth surface is retired when "a written storage image it does not serve overlaps it". Since #7050 (a714d1b37), a written storage view retires only depth surfaces whose whole plane it covers: ShaderResources.cpp:1134 passes the written bytes and extents to RetireCoveredDepthSurfaces, and DepthSurface.cpp:2489 retires a surface only when CoveredBy holds (DepthSurface.cpp:552-573: the written bytes or a matching block extent cover the whole depth or stencil plane), so a partial overlap leaves it alive. The clause now reads "a color target overlaps it, an unserved storage view writes a whole plane, or it is sampled ...".

#7154, merged since, edited the next sentence of the same line; this branch is rebased onto it and keeps its text. #9026 (f57bbc936a) has since changed the next entry, "Depth planes in guest memory"; this branch is rebased onto main 6ef5a1c4c9 and keeps that text too.

Tested

Docs only; nothing was built or run. Checked on main 6ef5a1c4c9 by reading ShaderResources.cpp:1134 and DepthSurface.cpp:552-573 and :2486-2491; the other retire path, RetireDepthSurfaces (DepthSurface.cpp:2479-2484), is called outside tests only for color targets (Graphics/src/Draw.cpp:2244). CoveredBy and both retire functions are unchanged since a07e985c8; only their line numbers moved.

  • python tools/check_conventions.py --base origin/main with this title and body passes.
  • 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:4935734580 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8423). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-20T12:30:05Z. --- ### What The `depth surface` entry in `docs/dev/debt/libSceAgcDriver.md` says a depth surface is retired when "a written storage image it does not serve overlaps it". Since #7050 (`a714d1b37`), a written storage view retires only depth surfaces whose whole plane it covers: `ShaderResources.cpp:1134` passes the written bytes and extents to `RetireCoveredDepthSurfaces`, and `DepthSurface.cpp:2489` retires a surface only when `CoveredBy` holds (`DepthSurface.cpp:552-573`: the written bytes or a matching block extent cover the whole depth or stencil plane), so a partial overlap leaves it alive. The clause now reads "a color target overlaps it, an unserved storage view writes a whole plane, or it is sampled ...". #7154, merged since, edited the next sentence of the same line; this branch is rebased onto it and keeps its text. #9026 (f57bbc936a) has since changed the next entry, "Depth planes in guest memory"; this branch is rebased onto `main` 6ef5a1c4c9 and keeps that text too. ### Tested Docs only; nothing was built or run. Checked on `main` 6ef5a1c4c9 by reading `ShaderResources.cpp:1134` and `DepthSurface.cpp:552-573` and `:2486-2491`; the other retire path, `RetireDepthSurfaces` (`DepthSurface.cpp:2479-2484`), is called outside tests only for color targets (`Graphics/src/Draw.cpp:2244`). `CoveredBy` and both retire functions are unchanged since `a07e985c8`; only their line numbers moved. - `python tools/check_conventions.py --base origin/main` with this title and body passes. - 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 05:59:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-21T05:59:57Z.

Review: APPROVED


Checked against main:

  • ShaderResources.cpp:1127-1130 calls RetireCoveredDepthSurfaces only for a written storage view that DepthSurfaceStorage (:1116) did not serve, so "an unserved storage view" is right.
  • DepthSurface.cpp:2216-2220 retires a surface only when CoveredBy (DepthSurface.cpp:512-531) holds. It holds when the written bytes, or a matching block extent, cover the whole depth or stencil plane, so a partial overlap leaves the surface alive, as the new text says.
  • The color-target path is the other retire call: RetireDepthSurfaces at Draw.cpp:2215. "A color target overlaps it" is unchanged and accurate.
  • tools/check_conventions.py --base main --head pr-8423 passes.

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

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5595537677 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8423#pullrequestreview-5595537677). Originally posted by [harisibrar1](https://github.com/harisibrar1) on 2026-10-21T05:59:57Z. **Review:** APPROVED --- Checked against main: - `ShaderResources.cpp:1127-1130` calls `RetireCoveredDepthSurfaces` only for a written storage view that `DepthSurfaceStorage` (:1116) did not serve, so "an unserved storage view" is right. - `DepthSurface.cpp:2216-2220` retires a surface only when `CoveredBy` (`DepthSurface.cpp:512-531`) holds. It holds when the written bytes, or a matching block extent, cover the whole depth or stencil plane, so a partial overlap leaves the surface alive, as the new text says. - The color-target path is the other retire call: `RetireDepthSurfaces` at `Draw.cpp:2215`. "A color target overlaps it" is unchanged and accurate. - `tools/check_conventions.py --base main --head pr-8423` passes. 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!8423
No description provided.