feat(agc): render into one depth slice of a 3D color target #449

Merged
MichonGoddijn231849 merged 2 commits from upstream-pr/449 into main 2026-10-04 22:45:29 +00:00
MichonGoddijn231849 commented 2026-10-03 09:32:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-03T09:32:32Z.


What

A color target whose CB_COLOR_ATTRIB3 resource type is 3D was refused with unsupported color depth, dimension, resource level or metadata mode. GTA V renders a 32x32x32 2_10_10_10 volume this way, one depth slice per color view, while loading.

  • Decode: DecodeColorTileMode accepts resource type 3D (any depth); type 2D still requires depth 0. DecodeColorBuffer reads the depth and takes the view slice as the depth slice (ColorTarget::depth, depthSlice). The surface address is not moved by the slice, as for array slices. Mipmapped and DCC 3D targets throw, and so does a slice beyond the depth.
  • Draw: SurfaceForTarget describes the target as a 3D surface. The resident storage image is attached through a 2D view of the depth slice. A 3D target without a resident image throws.
  • Storage images: 3D images are created 2D_ARRAY_COMPATIBLE and can be color attachments. StorageTexture::AttachmentView takes the depth slice, and its view cache key includes it.

Tested

Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.

  • ctest: all tests pass. agc_driver_graphics checks the new decode:
    • a view of depth slice 2 of a 4-deep 3D target keeps the surface address and selects slice 2;
    • slice 4 is refused;
    • a DCC 3D target is refused.
  • GTA V (PPSA04264), Prologue: the draw was refused at load. It now renders, with no skipped draws left in the Prologue, and the scene looks as before. Tested on my branch that combines this change with my other open PRs.

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
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #377 (color views of one array slice); its commit is included here until it merges
  • AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4725543010 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/449). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-03T09:32:32Z. --- ### What A color target whose `CB_COLOR_ATTRIB3` resource type is 3D was refused with `unsupported color depth, dimension, resource level or metadata mode`. GTA V renders a 32x32x32 `2_10_10_10` volume this way, one depth slice per color view, while loading. - **Decode:** `DecodeColorTileMode` accepts resource type 3D (any depth); type 2D still requires depth 0. `DecodeColorBuffer` reads the depth and takes the view slice as the depth slice (`ColorTarget::depth`, `depthSlice`). The surface address is not moved by the slice, as for array slices. Mipmapped and DCC 3D targets throw, and so does a slice beyond the depth. - **Draw:** `SurfaceForTarget` describes the target as a 3D surface. The resident storage image is attached through a 2D view of the depth slice. A 3D target without a resident image throws. - **Storage images:** 3D images are created `2D_ARRAY_COMPATIBLE` and can be color attachments. `StorageTexture::AttachmentView` takes the depth slice, and its view cache key includes it. ### Tested Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0. - `ctest`: all tests pass. `agc_driver_graphics` checks the new decode: - a view of depth slice 2 of a 4-deep 3D target keeps the surface address and selects slice 2; - slice 4 is refused; - a DCC 3D target is refused. - GTA V (PPSA04264), Prologue: the draw was refused at load. It now renders, with no skipped draws left in the Prologue, and the scene looks as before. Tested on my branch that combines this change with my other open PRs. ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #377 (color views of one array slice); its commit is included here until it merges - [x] AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-04 15:23:19 +00:00 (Migrated from github.com)

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


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
#505 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp L50
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5981541408 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/449#issuecomment-5981541408). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-04T15:23:19Z. --- <!-- pr-overlap --> 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 | |---|---|---|---| | #505 | `core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp` [L50](https://github.com/boykopovar/AnyPS5/blob/1bc945c1e5df5b99096f9ce35f0fb11ed5a134db/core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp#L50) | | |
oneandonlydean commented 2026-10-04 22:38:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T22:38:03Z.


Thanks. Its own commit has exactly the content that passed my PPSA21564 check, on top of #377 (carried unchanged), and it builds and passes ctest here on current main. Ready to merge right after #377. The red Windows job is the guest_audio_in_no_device flake that #532 fixed, so a re-run should clear it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985219506 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/449#issuecomment-5985219506). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T22:38:03Z. --- Thanks. Its own commit has exactly the content that passed my PPSA21564 check, on top of #377 (carried unchanged), and it builds and passes ctest here on current main. Ready to merge right after #377. The red Windows job is the `guest_audio_in_no_device` flake that #532 fixed, so a re-run should clear it.
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!449
No description provided.