AGC: 2D array color targets with a nonzero MIP0_DEPTH are rejected (VITA5, Homebrew UI Lab) #2578

Closed
opened 2026-10-10 06:50:30 +00:00 by AlxcBTW · 1 comment
AlxcBTW commented 2026-10-10 06:50:30 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-10T06:50:30Z.


VITA5 (PPSA39410) and Homebrew UI Lab (PPSA99050) stop at unsupported color depth, dimension, resource level or metadata mode with CB_COLOR_ATTRIB3 = 0x4dc6c001. That is a 2D color target with MIP0_DEPTH 1, rendered through a single-slice view.

Cause

DecodeColorTileMode accepts 2D color targets only when CB_COLOR_ATTRIB3.MIP0_DEPTH is 0, so a 2D array target can only be used when its surface declares one slice. radeonsi writes the last layer of the resource there for array targets (Mesa 35b085c4, src/gallium/drivers/radeonsi/si_state.c:2350 .num_layers = util_max_layer(...), src/amd/common/ac_descriptors.c:1319), and Mesa-built homebrew does the same.

Fix

AlxcBTW:fix/agc-array-color-target-v2 (5bef2fde). It is rebased onto main d5c8e42d and keeps the 1D color targets that 7638ade7 added: 1D still needs MIP0_DEPTH 0. In full CI, Linux and macOS pass. The only Windows failure is agc_driver_prepared_shaders_deferred_undecodable, which fails on every main run at the moment (fix: AlxcBTW/AnyPS5#13). The first version (6fca50cd, AlxcBTW/AnyPS5#3) passed fully on c72d5ce1. I can't open it as a PR while intake is limited, so it's here if a collaborator wants to cherry-pick it.

  • DecodeColorTileMode accepts 2D targets with any MIP0_DEPTH.
  • 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 the field is nonzero. Surfaces with MIP0_DEPTH 0 behave as before.

Tested

Windows 11, WinLibs GCC 15.2.0 r7.

  • ColorTargetLayout tests: 0x4dc6c001 is accepted, while 1D with a nonzero MIP0_DEPTH and resource type 3 are still rejected. Graphics tests: slice 1 of a two-slice linear target moves the address by one slice, and slice 2 is rejected. ctest -R ^agc on d5c8e42d: all pass except agc_driver_f32_arithmetic_nan, which fails the same way without the change on this NVIDIA GPU.
  • VITA5 and UI Lab with their import PRs merged get past the color target (the full chain is in #2026).

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5788929288 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2578). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-10T06:50:30Z. --- VITA5 (PPSA39410) and Homebrew UI Lab (PPSA99050) stop at `unsupported color depth, dimension, resource level or metadata mode` with `CB_COLOR_ATTRIB3 = 0x4dc6c001`. That is a 2D color target with `MIP0_DEPTH` 1, rendered through a single-slice view. ### Cause `DecodeColorTileMode` accepts 2D color targets only when `CB_COLOR_ATTRIB3.MIP0_DEPTH` is 0, so a 2D array target can only be used when its surface declares one slice. radeonsi writes the last layer of the resource there for array targets (Mesa `35b085c4`, `src/gallium/drivers/radeonsi/si_state.c:2350` `.num_layers = util_max_layer(...)`, `src/amd/common/ac_descriptors.c:1319`), and Mesa-built homebrew does the same. ### Fix [`AlxcBTW:fix/agc-array-color-target-v2`](https://github.com/AlxcBTW/AnyPS5/pull/9) (`5bef2fde`). It is rebased onto `main` d5c8e42d and keeps the 1D color targets that 7638ade7 added: 1D still needs `MIP0_DEPTH` 0. In [full CI](https://github.com/AlxcBTW/AnyPS5/actions/runs/38034776927), Linux and macOS pass. The only Windows failure is `agc_driver_prepared_shaders_deferred_undecodable`, which fails on every `main` run at the moment (fix: AlxcBTW/AnyPS5#13). The first version (`6fca50cd`, AlxcBTW/AnyPS5#3) passed fully on c72d5ce1. I can't open it as a PR while intake is limited, so it's here if a collaborator wants to cherry-pick it. - `DecodeColorTileMode` accepts 2D targets with any `MIP0_DEPTH`. - `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 the field is nonzero. Surfaces with `MIP0_DEPTH` 0 behave as before. ### Tested Windows 11, WinLibs GCC 15.2.0 r7. - `ColorTargetLayout` tests: `0x4dc6c001` is accepted, while 1D with a nonzero `MIP0_DEPTH` and resource type 3 are still rejected. `Graphics` tests: slice 1 of a two-slice linear target moves the address by one slice, and slice 2 is rejected. `ctest -R ^agc` on d5c8e42d: all pass except `agc_driver_f32_arithmetic_nan`, which fails the same way without the change on this NVIDIA GPU. - VITA5 and UI Lab with their import PRs merged get past the color target (the full chain is in #2026). AI-assisted: yes (Claude Code).
LeandroLP23 commented 2026-10-10 08:29:56 +00:00 (Migrated from github.com)
Author
Contributor

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


@AlxcBTW's 6fca50cd no longer applies to current main, and one of its test lines now contradicts main:

  • DecodeColorTileMode conflicts with 7638ade7 (main now renders into 1D color targets as one-row 2D targets, resourceType <= 1). I resolved it so that 1D targets keep the MIP0_DEPTH == 0 rule from main and 2D targets accept any MIP0_DEPTH, as this fix intends: ((resourceType == 0 && (attrib3 & 0x1fffu) == 0) || resourceType == 1 || resourceType == 2).
  • The fix's reject([] { DecodeColorTileMode(0x4cc6c000); }) in tests/ColorTargetLayout.cpp expects that descriptor to be rejected, but 0x4cc6c000 is a 1D target (type 0, depth 0, mode 0x1b) that main's test now requires to be accepted. A plain merge keeps both lines and agc_driver_graphics fails with expected color layout rejection, so I dropped that line, and the fix's second reject(0x4fc6c000), which main already has.

Rebased commit (still authored by AlxcBTW): LeandroLP23:rebase/agc-array-color-target (31201433, on main 89a1fb4e, also merges cleanly onto 6cc33583). Radeon 860M (RDNA 3.5), Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release: all 247 agc_driver tests pass, conventions pass. I have neither VITA5 nor Homebrew UI Lab, so the titles themselves are untested here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095690633 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2578#issuecomment-6095690633). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-10T08:29:56Z. --- @AlxcBTW's 6fca50cd no longer applies to current `main`, and one of its test lines now contradicts `main`: - `DecodeColorTileMode` conflicts with 7638ade7 (`main` now renders into 1D color targets as one-row 2D targets, `resourceType <= 1`). I resolved it so that 1D targets keep the `MIP0_DEPTH == 0` rule from `main` and 2D targets accept any `MIP0_DEPTH`, as this fix intends: `((resourceType == 0 && (attrib3 & 0x1fffu) == 0) || resourceType == 1 || resourceType == 2)`. - The fix's `reject([] { DecodeColorTileMode(0x4cc6c000); })` in `tests/ColorTargetLayout.cpp` expects that descriptor to be rejected, but `0x4cc6c000` is a 1D target (type 0, depth 0, mode 0x1b) that `main`'s test now requires to be accepted. A plain merge keeps both lines and `agc_driver_graphics` fails with `expected color layout rejection`, so I dropped that line, and the fix's second `reject(0x4fc6c000)`, which `main` already has. Rebased commit (still authored by AlxcBTW): [`LeandroLP23:rebase/agc-array-color-target`](https://github.com/LeandroLP23/AnyPS5/tree/rebase/agc-array-color-target) (`31201433`, on `main` 89a1fb4e, also merges cleanly onto 6cc33583). Radeon 860M (RDNA 3.5), Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release: all 247 `agc_driver` tests pass, conventions pass. I have neither VITA5 nor Homebrew UI Lab, so the titles themselves are untested here.
Sign in to join this conversation.
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#2578
No description provided.