fix(agc): render into one slice of a 2D array color target #2626

Merged
oneandonlydean merged 1 commit from upstream-pr/2626 into main 2026-10-10 08:48:30 +00:00
oneandonlydean commented 2026-10-10 08:29:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T08:29:39Z.


Carrying @AlxcBTW's fix for #2578 while PR intake is paused. The change is theirs (from AlxcBTW/AnyPS5:fix/agc-array-color-target-v2, 5bef2fde, the version rebased onto the 1D color target change).

What

  • DecodeColorTileMode accepts 2D color targets with any MIP0_DEPTH. 1D targets still need MIP0_DEPTH 0, and resource type 3 is still rejected.
  • DecodeColorBuffer already moves a 2D target by the view's slice times the slice size. It now also rejects a view slice beyond MIP0_DEPTH when that field is nonzero. Surfaces with MIP0_DEPTH 0 behave as before.

Why

VITA5 (PPSA39410) and Homebrew UI Lab (PPSA99050) stop at

unsupported color depth, dimension, resource level or metadata mode

with CB_COLOR_ATTRIB3 = 0x4dc6c001: a 2D color target with MIP0_DEPTH 1, rendered through a single-slice view. radeonsi writes the last layer of the resource there for array targets (Mesa src/gallium/drivers/radeonsi/si_state.c, src/amd/common/ac_descriptors.c), and Mesa-built homebrew does the same.

Tested

  • The author's full CI on d5c8e42d: Linux and macOS pass. The one Windows failure, agc_driver_prepared_shaders_deferred_undecodable, fails on every main run at the moment. The first version passed full CI on c72d5ce1.
  • ColorTargetLayout tests: 0x4dc6c001 is accepted, 1D with a nonzero MIP0_DEPTH and resource type 3 are still rejected. Graphics tests: slice 1 of a two-slice target moves the address by one slice, and slice 2 is rejected.
  • VITA5 and UI Lab with their import fixes get past the color target (the chain is in #2026).
  • tools/check_conventions.py passes, and the branch merges cleanly with current main.

Fixes #2578

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: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4809898886 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2626). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T08:29:39Z. --- Carrying @AlxcBTW's fix for #2578 while PR intake is paused. The change is theirs (from `AlxcBTW/AnyPS5:fix/agc-array-color-target-v2`, 5bef2fde, the version rebased onto the 1D color target change). ### What - `DecodeColorTileMode` accepts 2D color targets with any `MIP0_DEPTH`. 1D targets still need `MIP0_DEPTH` 0, and resource type 3 is still rejected. - `DecodeColorBuffer` already moves a 2D target by the view's slice times the slice size. It now also rejects a view slice beyond `MIP0_DEPTH` when that field is nonzero. Surfaces with `MIP0_DEPTH` 0 behave as before. ### Why VITA5 (PPSA39410) and Homebrew UI Lab (PPSA99050) stop at ``` unsupported color depth, dimension, resource level or metadata mode ``` with `CB_COLOR_ATTRIB3 = 0x4dc6c001`: a 2D color target with `MIP0_DEPTH` 1, rendered through a single-slice view. radeonsi writes the last layer of the resource there for array targets (Mesa `src/gallium/drivers/radeonsi/si_state.c`, `src/amd/common/ac_descriptors.c`), and Mesa-built homebrew does the same. ### Tested - The author's full CI on d5c8e42d: Linux and macOS pass. The one Windows failure, `agc_driver_prepared_shaders_deferred_undecodable`, fails on every `main` run at the moment. The first version passed full CI on c72d5ce1. - `ColorTargetLayout` tests: `0x4dc6c001` is accepted, 1D with a nonzero `MIP0_DEPTH` and resource type 3 are still rejected. `Graphics` tests: slice 1 of a two-slice target moves the address by one slice, and slice 2 is rejected. - VITA5 and UI Lab with their import fixes get past the color target (the chain is in #2026). - `tools/check_conventions.py` passes, and the branch merges cleanly with current `main`. Fixes #2578 ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes
adriadam10 commented 2026-10-10 08:48:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T08:48:27Z.


Checked on the PR merged onto current main: libSceAgcDriver build + ctest green (agc_driver_graphics passes, and fails with the two source changes reverted); the new rows pin 0x4dc6c001 accepted, 1D with nonzero MIP0_DEPTH and resource type 3 still rejected, slice 1 moves by one slice, slice 2 rejected. Not run here: VITA5 / UI Lab on a real title. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095827235 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2626#issuecomment-6095827235). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T08:48:27Z. --- Checked on the PR merged onto current `main`: libSceAgcDriver build + ctest green (`agc_driver_graphics` passes, and fails with the two source changes reverted); the new rows pin `0x4dc6c001` accepted, 1D with nonzero `MIP0_DEPTH` and resource type 3 still rejected, slice 1 moves by one slice, slice 2 rejected. Not run here: VITA5 / UI Lab on a real title. Merging once CI is green.
AlxcBTW commented 2026-10-10 09:12:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-10T09:12:00Z.


Title run for this change, since it wasn't run on a title above: Windows 11, RTX 5070 Laptop (616.92), main 05e884ca with #2625 and #2626 merged, plus #2627, AlxcBTW/AnyPS5#12 (#1413) and the titles' import PRs.

  • VITA5 (PPSA39410) gets past the array color target and runs for 60 s: [VD5] frames=600 mean=16.69ms max=27.43ms.
  • Homebrew UI Lab (PPSA99050) runs for 60 s when the driver cache already holds its large pixel shader. From a cold driver cache it stops earlier, at its own 2 s wait for a submission to retire, while the driver compiles that shader (14.7 s here). That is a separate problem, and I'll open an issue with the measurements.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6096000984 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2626#issuecomment-6096000984). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-10T09:12:00Z. --- Title run for this change, since it wasn't run on a title above: Windows 11, RTX 5070 Laptop (616.92), `main` 05e884ca with #2625 and #2626 merged, plus #2627, AlxcBTW/AnyPS5#12 (#1413) and the titles' import PRs. - VITA5 (PPSA39410) gets past the array color target and runs for 60 s: `[VD5] frames=600 mean=16.69ms max=27.43ms`. - Homebrew UI Lab (PPSA99050) runs for 60 s when the driver cache already holds its large pixel shader. From a cold driver cache it stops earlier, at its own 2 s wait for a submission to retire, while the driver compiles that shader (14.7 s here). That is a separate problem, and I'll open an issue with the measurements. AI-assisted: yes (Claude Code).
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!2626
No description provided.