fix(agc): accept a linear 2D texture whose DEPTH holds its default pitch #4245

Merged
reyani-dev merged 1 commit from upstream-pr/4245 into main 2026-10-12 10:48:01 +00:00
reyani-dev commented 2026-10-12 02:14:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-12T02:14:46Z.


What

On GFX10.3 the DEPTH field (word 4) of a 1D or 2D non-array T# with linear tiling carries the row pitch minus one. Mesa's ac_descriptors.c sets it that way for custom pitches: "GFX10.3+ can set a custom pitch for 1D and 2D non-array, but it must be a multiple of 256B". DecodeTextureResource rejects every 2D descriptor with a nonzero DEPTH, so these are refused.

This accepts the case titles use and nothing more. A 2D linear, single-level, uncompressed T# whose DEPTH + 1 equals its default pitch (the width aligned to 256 bytes, which is the layout ComputeLinearMipLayout already uses) decodes as that 2D texture. Any other pitch, more mip levels, a block-compressed format or a nonzero base array still throws, with "custom pitch other than its default pitch". Tiled 2D descriptors with a nonzero DEPTH keep the old error.

Titles: Jelly5 (PPSA99505), Emby5 (PPSA99515) and Nuvio PS5 (PPSA99997) stop here on main d371ed307, now that #3496 and #3807 are in:

  what():  AGC graphics: guest 2D texture descriptor has a nonzero depth or base array

The rejected descriptors (from a local debug print) are linear RGBA8 textures whose DEPTH is exactly the 256-byte-aligned pitch:

depth=127 baseArray=0 w=72 h=72 tile=0 fmt=56 words=022e6760 c3800000 0011c011 90000fac 0000007f 00700000 00000000 00000000
depth=63  baseArray=0 w=8  h=8  tile=0 fmt=56 words=0222627e c3800000 0001c001 90000fac 0000003f 00700000 00000000 00000000

72 RGBA8 texels make 288 bytes, which aligns to 512 bytes = 128 texels; 8 texels align to 256 bytes = 64 texels. With this change all three run the full 60 s with no error in either log.

Tested

Windows 11 (26200), RTX 4070, WinLibs GCC 15.2.0 r7, Release, main d371ed307:

  • agc_driver_graphics (RunGuestTextureResourceTests):
    • The 72x72/DEPTH 127 and 8x8/DEPTH 63 descriptors decode as 2D with depthOrLastArray == 0.
    • A non-default pitch, two mip levels, and the old DEPTH 1 case are rejected as custom pitches.
    • A tiled 2D descriptor with DEPTH 1 still gets "nonzero depth or base array".
    • These fail with main's GuestTextureResource.cpp and pass with this change.
  • ctest -E "^agc_|video_out": 488/488.
  • GPU suite (VK_LOADER_DRIVERS_DISABLE=*dzn*, #3255): 432/433. agc_driver_prepared_shaders_deferred exited 0xc0000374 once under -j4 and passed 5/5 on its own; it doesn't decode textures.
  • The three titles above, before and after.
  • tools/check_conventions.py and tools/pr_overlap.py: clean.

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 (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4824132089 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4245). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-12T02:14:46Z. --- ### What On GFX10.3 the DEPTH field (word 4) of a 1D or 2D non-array T# with linear tiling carries the row pitch minus one. Mesa's `ac_descriptors.c` sets it that way for custom pitches: "GFX10.3+ can set a custom pitch for 1D and 2D non-array, but it must be a multiple of 256B". `DecodeTextureResource` rejects every 2D descriptor with a nonzero DEPTH, so these are refused. This accepts the case titles use and nothing more. A 2D linear, single-level, uncompressed T# whose DEPTH + 1 equals its default pitch (the width aligned to 256 bytes, which is the layout `ComputeLinearMipLayout` already uses) decodes as that 2D texture. Any other pitch, more mip levels, a block-compressed format or a nonzero base array still throws, with "custom pitch other than its default pitch". Tiled 2D descriptors with a nonzero DEPTH keep the old error. **Titles:** Jelly5 (PPSA99505), Emby5 (PPSA99515) and Nuvio PS5 (PPSA99997) stop here on `main` d371ed307, now that #3496 and #3807 are in: ``` what(): AGC graphics: guest 2D texture descriptor has a nonzero depth or base array ``` The rejected descriptors (from a local debug print) are linear RGBA8 textures whose DEPTH is exactly the 256-byte-aligned pitch: ``` depth=127 baseArray=0 w=72 h=72 tile=0 fmt=56 words=022e6760 c3800000 0011c011 90000fac 0000007f 00700000 00000000 00000000 depth=63 baseArray=0 w=8 h=8 tile=0 fmt=56 words=0222627e c3800000 0001c001 90000fac 0000003f 00700000 00000000 00000000 ``` 72 RGBA8 texels make 288 bytes, which aligns to 512 bytes = 128 texels; 8 texels align to 256 bytes = 64 texels. With this change all three run the full 60 s with no error in either log. ### Tested Windows 11 (26200), RTX 4070, WinLibs GCC 15.2.0 r7, Release, `main` d371ed307: - `agc_driver_graphics` (`RunGuestTextureResourceTests`): - The 72x72/DEPTH 127 and 8x8/DEPTH 63 descriptors decode as 2D with `depthOrLastArray == 0`. - A non-default pitch, two mip levels, and the old DEPTH 1 case are rejected as custom pitches. - A tiled 2D descriptor with DEPTH 1 still gets "nonzero depth or base array". - These fail with main's `GuestTextureResource.cpp` and pass with this change. - `ctest -E "^agc_|video_out"`: 488/488. - GPU suite (`VK_LOADER_DRIVERS_DISABLE=*dzn*`, #3255): 432/433. `agc_driver_prepared_shaders_deferred` exited `0xc0000374` once under `-j4` and passed 5/5 on its own; it doesn't decode textures. - The three titles above, before and after. - `tools/check_conventions.py` and `tools/pr_overlap.py`: clean. ### 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 (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
reyani-dev commented 2026-10-12 02:42:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-12T02:42:57Z.


A fourth title: EVO Player (PPSA99039) stops on the same check on main d371ed30 in a second full catalog run (what(): AGC graphics: guest 2D texture descriptor has a nonzero depth or base array). In my first run it hadn't reached that draw within the 60 s.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6116796306 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4245#issuecomment-6116796306). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-12T02:42:57Z. --- A fourth title: EVO Player (PPSA99039) stops on the same check on `main` d371ed30 in a second full catalog run (`what(): AGC graphics: guest 2D texture descriptor has a nonzero depth or base array`). In my first run it hadn't reached that draw within the 60 s.
LeandroLP23 commented 2026-10-12 07:42:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-12T07:42:37Z.


EVO Player (PPSA99039 v0.10.0), before and after, on Windows 11 (26300), Radeon 860M, WinLibs GCC 15.2.0 r7, Release. eboot.bin and sce_module/libc.prx are unwrapped, and each run lasts 60 s.

  • main fedcb3c81: stops at its first presentation with AGC graphics: guest 2D texture descriptor has a nonzero depth or base array.
  • This head (6b2432875) merged onto that main: the title runs the full 60 s in 2 of 2 runs, with no throw. Its own status line reaches agc health frame=600 … ring_fail=0 tex_fail=0 … presents=600. The only error it logs is its own open('/data/evoplayer/themes') failed (errno=2), for an optional theme directory.
  • agc_driver_graphics passes on the same build.

So the fix also holds on AMD's Windows driver, alongside your RTX 4070 runs.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119932730 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4245#issuecomment-6119932730). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-12T07:42:37Z. --- EVO Player (PPSA99039 v0.10.0), before and after, on Windows 11 (26300), Radeon 860M, WinLibs GCC 15.2.0 r7, Release. `eboot.bin` and `sce_module/libc.prx` are unwrapped, and each run lasts 60 s. - `main` `fedcb3c81`: stops at its first presentation with `AGC graphics: guest 2D texture descriptor has a nonzero depth or base array`. - This head (`6b2432875`) merged onto that `main`: the title runs the full 60 s in 2 of 2 runs, with no throw. Its own status line reaches `agc health frame=600 … ring_fail=0 tex_fail=0 … presents=600`. The only error it logs is its own `open('/data/evoplayer/themes') failed (errno=2)`, for an optional theme directory. - `agc_driver_graphics` passes on the same build. So the fix also holds on AMD's Windows driver, alongside your RTX 4070 runs.
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!4245
No description provided.