feat(agc): fast clear the CMASK of array and layered color targets #8065

Closed
ArielWolle wants to merge 7 commits from upstream-pr/8065 into main
ArielWolle commented 2026-10-19 19:26:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ArielWolle on 2026-10-19T19:26:49Z.


What

Fast clears the CMASK of array and layered color targets instead of throwing CMASK fast clears of a 3D or array color target are unsupported. Each layer is cleared through its own CMASK slice: the color address, the CMASK address and the pipe-bank XOR are offset per slice, the CMASK range check covers every layer, and the written-buffer ranges cover all layers. A 3D color target and a slice or array of a mipmapped target still throw, as recorded in the technical debt entry. The per-slice CMASK stride follows Addrlib's slice size and has not been measured on hardware.

Stacked on #7254 (layered draws into 2D array color views) and #7668 (CMASK offset of a color target slice); their commits are in this branch until they merge.

Tested

Windows 11, MinGW Release build based on main c0adf025b, with ANYPS5_REQUIRE_VULKAN=1:

  • ctest -R '^(agc_driver_graphics|agc_driver_cmask_fast_clear)$' --output-on-failure: passed (2/2)
  • ctest -R layered_array_color_draw --output-on-failure: passed
  • python3 tools/check_conventions.py --base origin/main: 0 errors (the existing debt-length warnings)
  • NHL 27 (PPSA34063) used to stop at this error in the menus; the full title run with this change is in progress.

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: #7254, #7668
  • Fixes: none
  • Unblocks: PPSA34063 #4275
  • GPUs tested: NVIDIA GeForce RTX 3070, driver 617.42, Windows 11 (build 26200): the unit tests and the layered array draw test
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4926237571 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8065). Originally posted by [ArielWolle](https://github.com/ArielWolle) on 2026-10-19T19:26:49Z. --- ### What Fast clears the CMASK of array and layered color targets instead of throwing `CMASK fast clears of a 3D or array color target are unsupported`. Each layer is cleared through its own CMASK slice: the color address, the CMASK address and the pipe-bank XOR are offset per slice, the CMASK range check covers every layer, and the written-buffer ranges cover all layers. A 3D color target and a slice or array of a mipmapped target still throw, as recorded in the technical debt entry. The per-slice CMASK stride follows Addrlib's slice size and has not been measured on hardware. Stacked on #7254 (layered draws into 2D array color views) and #7668 (CMASK offset of a color target slice); their commits are in this branch until they merge. ### Tested Windows 11, MinGW Release build based on `main` `c0adf025b`, with `ANYPS5_REQUIRE_VULKAN=1`: - `ctest -R '^(agc_driver_graphics|agc_driver_cmask_fast_clear)$' --output-on-failure`: passed (2/2) - `ctest -R layered_array_color_draw --output-on-failure`: passed - `python3 tools/check_conventions.py --base origin/main`: 0 errors (the existing debt-length warnings) - NHL 27 (PPSA34063) used to stop at this error in the menus; the full title run with this change is in progress. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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: #7254, #7668 - [x] Fixes: none - [x] Unblocks: PPSA34063 #4275 - [x] GPUs tested: NVIDIA GeForce RTX 3070, driver 617.42, Windows 11 (build 26200): the unit tests and the layered array draw test - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-19 19:27:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T19:27:10Z.


Thank you for your contribution! Authors with no pull requests merged into main can have 1 open pull request at a time, authors with at least 1 merged can have 20, and from 20 merged there is no limit. This PR has been automatically closed and labeled "open PR limit" because that limit was reached. This is not a judgment of the quality of your changes: reopen it once one of your open pull requests is merged or closed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6275468117 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8065#issuecomment-6275468117). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T19:27:10Z. --- Thank you for your contribution! Authors with no pull requests merged into `main` can have 1 open pull request at a time, authors with at least 1 merged can have 20, and from 20 merged there is no limit. This PR has been automatically closed and labeled "open PR limit" because that limit was reached. This is not a judgment of the quality of your changes: reopen it once one of your open pull requests is merged or closed.
oneandonlydean commented 2026-10-20 08:24:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T08:24:07Z.


This was closed by the open-PR limit while our intake was paused, not on its merits. GitHub won't reopen it because the branch changed after the close, so we'll carry it in a new PR that credits you, and review it under the normal process.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6286724972 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8065#issuecomment-6286724972). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T08:24:07Z. --- This was closed by the open-PR limit while our intake was paused, not on its merits. GitHub won't reopen it because the branch changed after the close, so we'll carry it in a new PR that credits you, and review it under the normal process.

Pull request closed

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!8065
No description provided.