feat(libSceAgcDriver): lay out PS4 textures in tile mode 19 (Thick_1dThick) #9674

Merged
ntamas94 merged 12 commits from upstream-pr/9674 into main 2026-11-04 05:33:42 +00:00
ntamas94 commented 2026-10-22 07:45:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-10-22T07:45:07Z.


What

A PS4 T# with tile mode index 19 (Thick_1dThick) threw. Gang Beasts (CUSA04865, Unity) hits it.

The mode stores 8x8x4 micro tiles. Within a tile the elements follow addrlib's ADDR_THICK order for their size:

  • 8 and 16 bits: x0 y0 x1 y1 z0 z1 x2 y2;
  • 32 bits: x0 y0 x1 z0 y1 z1 x2 y2;
  • 64 and 128 bits: x0 y0 z0 x1 y1 z1 x2 y2.

Level 0 and levels at least four slices deep keep their slices as slabs of four. Nonzero levels below four slices degrade to 1D thin, one slice per stride, with SI pitch adjustment to a 256-byte slice alignment. Only thick 3D textures take this layout; a block-compressed volume, which addrlib lays out thin, throws. I checked the layout against addrlib, Mesa, GPCS4, shadPS4 and fpPS4. New TextureTiling cases check that a micro tile maps its 8x8x4 elements one to one, the first steps of the element order for each size, and the level and slab offsets of a small volume. The debt entry for PS4 thick and layered surfaces now says which thick mode is laid out, that tile mode 19 is checked against the layout tests only and not by GcnDetile.cpp's GPU run, and that a thick mode on a 1D-array, 2D, 2D-array or cube T# throws: describeGcnSurface refuses those instead of taking the thin layout, since addrlib groups their slices in fours too and the thin path would read them from wrong offsets. A new TextureTiling case checks the refusal.

MarcZX10 found that a volume with several mip levels is stored level by level here (each level with all of its slabs, as addrlib lays a thick 3D mip chain out), while StorageTexture and the write evidence computed GuestLayerOffset(layer) + mip.tiledOffset, one layerBytes stride for every level, which is right only for level 0. Those nine call sites now use SurfaceGeometry::GuestOffset(layer, mip), which already carries the level-major rule and is what the sampled upload used; for every other geometry the two expressions are equal. A storage image of a level-major surface still throws at creation (Texture.cpp, the rule #9431 added for layered surfaces), so the wrong stride was not reachable for a volume with mips, and the debt entry says so. A new TextureTiling case lays out a 32x32x32 volume with four levels (8, 4, 2 and 1 slabs) and checks that every slice's slab offset is inside the surface, that the slabs do not overlap, that they fill the surface exactly, and that level 1's second slab sits one level-1 slab after its first.

This moves the tile-mode commit of Get-fix/AnyPS5#4 (opened against ps4/limbo-gpu) to main, as Get-fix asked there. It was stacked on #9431, which is merged; the branch now has current main merged in. The other commit of that PR drew quad lists through the rect-list tessellation stages; main already draws quad lists by generating a triangle-list index buffer with the first or last provoking vertex, so it is not carried over.

Landing order: #9891 lays out thin-tiled 3D textures in the same function; the two fit together (thick 3D here, thin 3D there, a non-3D thick T# throws) and merge as two adjacent lines plus one debt entry. Suggested: #9891 first, then this PR rebased onto it.

Tested

Windows 11 Pro (10.0.26200), WinLibs GCC, NVIDIA GeForce RTX 2080 (driver 617.14), Release build with BUILD_TESTING=ON, on this branch with current main (e30f38577c) merged in; #9431 is merged, so the branch's diff against main is this PR's own change:

  • agc_driver_graphics passes, with the new thick TextureTiling cases, including the 32x32x32 four-level volume; three runs. A 2D-array T# in tile mode 19 still throws, but the test no longer pins that, since the console accepts layered thick surfaces.
  • agc_driver_gcn_detile passes.
  • Earlier, on Get-fix/AnyPS5#4 with the rest of my bring-up branch (#7941): Gang Beasts plays a full round.
  • tools/check_conventions.py --base main (e30f38577c) with this title and description: no findings.
  • Paired validation-layer run: main e30f38577c (100% tests passed out of 25, the depth, display-buffer and graphics tests of this stack) and this branch with that main merged in (100% tests passed out of 2: agc_driver_graphics, agc_driver_gcn_detile) with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 and VK_LOADER_DEBUG=warn,error, ctest -V, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200), Vulkan SDK 1.4.363.0: both logs carry the loader's adding layers "VK_LAYER_KHRONOS_validation" line (62 and 2 times) and neither reports was not found but was requested by env var VK_INSTANCE_LAYERS; VUID- ids on main: 0, on this branch: 0, new on this branch: 0.

Linux was not run locally.

Refresh — 2026-11-03 (Codex, AI-assisted): Merged main 086c0686c8. Fixed the shallow-mip finding: nonzero mip levels with fewer than four slices use 1D thin tiles, one-slice guest strides, and SI pitch adjustment until the slice size is 256-byte aligned. The detiler selects the thin pipeline for these levels. Added full 32x32x32/6-level regression (151296 bytes; level-4 slice 1 at 150784), thin/thick mode selection and 8/16-bit slice-alignment checks. Ran the actual gcnThickTilingTests function in an isolated statically linked CPU harness with the current TextureTiling.cpp and TextureFormat.cpp: passes. Replacing only TextureTiling.cpp with the pre-fix version fails with 'PS4 full volume mip chain differs from addrlib'. Generated all four current TextureDetile shader variants with glslang. Syntax-only compilation passes for TextureDetiler.cpp and ShaderResources.cpp; conventions and whitespace checks pass. Full agc_driver_graphics, GPU detiler, paired Vulkan validation and title runs have not been rerun on this merged head; the harness is CPU layout evidence only.

Checklist

  • Based on current main; no other open PR implements the same functions (current main e30f38577c merged in; #9431 is merged; searched open boykopovar/AnyPS5 PRs for Thick_1dThick, thick tile mode and tile mode 19 on 2026-10-22)
  • 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: none (#9431 is merged)
  • Fixes: none
  • Unblocks: CUSA04865 #7941
  • GPUs tested: NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4963906778 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9674). Originally posted by [ntamas94](https://github.com/ntamas94) on 2026-10-22T07:45:07Z. --- ### What A PS4 T# with tile mode index 19 (`Thick_1dThick`) threw. Gang Beasts (CUSA04865, Unity) hits it. The mode stores 8x8x4 micro tiles. Within a tile the elements follow addrlib's `ADDR_THICK` order for their size: - 8 and 16 bits: x0 y0 x1 y1 z0 z1 x2 y2; - 32 bits: x0 y0 x1 z0 y1 z1 x2 y2; - 64 and 128 bits: x0 y0 z0 x1 y1 z1 x2 y2. Level 0 and levels at least four slices deep keep their slices as slabs of four. Nonzero levels below four slices degrade to 1D thin, one slice per stride, with SI pitch adjustment to a 256-byte slice alignment. Only thick 3D textures take this layout; a block-compressed volume, which addrlib lays out thin, throws. I checked the layout against addrlib, Mesa, GPCS4, shadPS4 and fpPS4. New `TextureTiling` cases check that a micro tile maps its 8x8x4 elements one to one, the first steps of the element order for each size, and the level and slab offsets of a small volume. The debt entry for PS4 thick and layered surfaces now says which thick mode is laid out, that tile mode 19 is checked against the layout tests only and not by `GcnDetile.cpp`'s GPU run, and that a thick mode on a 1D-array, 2D, 2D-array or cube T# throws: `describeGcnSurface` refuses those instead of taking the thin layout, since addrlib groups their slices in fours too and the thin path would read them from wrong offsets. A new `TextureTiling` case checks the refusal. MarcZX10 found that a volume with several mip levels is stored level by level here (each level with all of its slabs, as addrlib lays a thick 3D mip chain out), while `StorageTexture` and the write evidence computed `GuestLayerOffset(layer) + mip.tiledOffset`, one `layerBytes` stride for every level, which is right only for level 0. Those nine call sites now use `SurfaceGeometry::GuestOffset(layer, mip)`, which already carries the level-major rule and is what the sampled upload used; for every other geometry the two expressions are equal. A storage image of a level-major surface still throws at creation (`Texture.cpp`, the rule #9431 added for layered surfaces), so the wrong stride was not reachable for a volume with mips, and the debt entry says so. A new `TextureTiling` case lays out a 32x32x32 volume with four levels (8, 4, 2 and 1 slabs) and checks that every slice's slab offset is inside the surface, that the slabs do not overlap, that they fill the surface exactly, and that level 1's second slab sits one level-1 slab after its first. This moves the tile-mode commit of Get-fix/AnyPS5#4 (opened against `ps4/limbo-gpu`) to `main`, as Get-fix asked there. It was stacked on #9431, which is merged; the branch now has current `main` merged in. The other commit of that PR drew quad lists through the rect-list tessellation stages; `main` already draws quad lists by generating a triangle-list index buffer with the first or last provoking vertex, so it is not carried over. Landing order: #9891 lays out thin-tiled 3D textures in the same function; the two fit together (thick 3D here, thin 3D there, a non-3D thick T# throws) and merge as two adjacent lines plus one debt entry. Suggested: #9891 first, then this PR rebased onto it. ### Tested Windows 11 Pro (10.0.26200), WinLibs GCC, NVIDIA GeForce RTX 2080 (driver 617.14), Release build with `BUILD_TESTING=ON`, on this branch with current `main` (e30f38577c) merged in; #9431 is merged, so the branch's diff against `main` is this PR's own change: - `agc_driver_graphics` passes, with the new thick `TextureTiling` cases, including the 32x32x32 four-level volume; three runs. A 2D-array T# in tile mode 19 still throws, but the test no longer pins that, since the console accepts layered thick surfaces. - `agc_driver_gcn_detile` passes. - Earlier, on Get-fix/AnyPS5#4 with the rest of my bring-up branch (#7941): Gang Beasts plays a full round. - `tools/check_conventions.py --base main` (e30f38577c) with this title and description: no findings. - Paired validation-layer run: `main` e30f38577c (100% tests passed out of 25, the depth, display-buffer and graphics tests of this stack) and this branch with that `main` merged in (100% tests passed out of 2: `agc_driver_graphics`, `agc_driver_gcn_detile`) with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1` and `VK_LOADER_DEBUG=warn,error`, `ctest -V`, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200), Vulkan SDK 1.4.363.0: both logs carry the loader's `adding layers "VK_LAYER_KHRONOS_validation"` line (62 and 2 times) and neither reports `was not found but was requested by env var VK_INSTANCE_LAYERS`; `VUID-` ids on `main`: 0, on this branch: 0, new on this branch: 0. Linux was not run locally. **Refresh — 2026-11-03 (Codex, AI-assisted):** Merged main 086c0686c8. Fixed the shallow-mip finding: nonzero mip levels with fewer than four slices use 1D thin tiles, one-slice guest strides, and SI pitch adjustment until the slice size is 256-byte aligned. The detiler selects the thin pipeline for these levels. Added full 32x32x32/6-level regression (151296 bytes; level-4 slice 1 at 150784), thin/thick mode selection and 8/16-bit slice-alignment checks. Ran the actual gcnThickTilingTests function in an isolated statically linked CPU harness with the current TextureTiling.cpp and TextureFormat.cpp: passes. Replacing only TextureTiling.cpp with the pre-fix version fails with 'PS4 full volume mip chain differs from addrlib'. Generated all four current TextureDetile shader variants with glslang. Syntax-only compilation passes for TextureDetiler.cpp and ShaderResources.cpp; conventions and whitespace checks pass. Full agc_driver_graphics, GPU detiler, paired Vulkan validation and title runs have not been rerun on this merged head; the harness is CPU layout evidence only. ### 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 (current `main` e30f38577c merged in; #9431 is merged; searched open boykopovar/AnyPS5 PRs for `Thick_1dThick`, thick tile mode and tile mode 19 on 2026-10-22) - [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: none (#9431 is merged) - [x] Fixes: none - [x] Unblocks: CUSA04865 #7941 - [x] GPUs tested: NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200) - [x] AI-assisted: yes
fogydes commented 2026-10-22 08:47:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-10-22T08:47:29Z.


Reviewed; the mode-19 volume layout itself checks out. The math I recomputed matches the addrlib ADDR_THICK family: 8x8x4 micro tiles, the three element-size orders written into the equation bits (z-bits 4/3/2 depending on bytes per element), depth padded to 4 with level-major ×4 slab factors, slabs = ceil(depth/4), and the bijectivity test exercises all five element sizes — the 5120/2048/4096 extents recompute correctly for the tested depth values. Sources are cited properly and throws are kept for GB_TILE_MODE 15, 20-26 and block-compressed volumes. The conflict with today's main (both hunks in Graphics/src/State.cpp' decodeDepth) is measured, and the rebase also collides with main's rewrite of the "Depth planes in guest memory" debt entry — main moved on the exact prose this PR touches.

Two gaps to close before this is trustworthy beyond the game run:

  1. The debt entry's last sentence is now false on this same branch. "GcnDetile.cpp runs the GPU detiler over every mode that does not throw" — but the branch's GcnDetile.cpp mode list is exactly {kGcnThin1D, kGcnDisplay1D, kGcnDisplay2D, kGcnThin2D, kGcnDepth2D64, kGcnDepth2D256, kGcnDepth2D1K, kGcnDisplayPrt, kGcnThin2DPrt, kGcnDepthPrt256}; kGcnThick1D is missing, and neither that file nor TextureDetiler tests gained a case, while the detiler gate now admits the mode. Either add a mode-19 GPU detile/retile case (the honest fix — the mode exists in the fence-style gate, so the device path will run it) or scope the debt sentence to the modes it actually covers.

  2. A non-3D descriptor in tile mode 19 silently produces wrong offsets. describeGcnSurface diverts to the volume path only when dimension == k3D && IsGcnThick(...), and IsGcnMacroTiled returns false for kGcnThick1D — so a 2D/2DArray/1DArray/cube T# in mode 19 falls through to the generic GCN layout, which sizes each layer as a thin slice (no ×4 slab factor, no 8x8x4 z-interleave inside a 4-slice chunk). On hardware Array1DTiledThick still groups slices into 4-slice chunks, so the layers of the first chunk would interleave in guest memory and the generic path would detile them from wrong offsets. No tested or known title hits it (only the 3D case from the title run is recorded), but "silent wrong answer for an untested descriptor shape" is worse than throwing: if the cited sources say those dimensions cannot carry mode 19, make it throw and record it; if they can, this needs the volume path extended to layered layouts. Right now it's neither.

Also worth one more test row when convenient: the new gcnThickTilingTests only pin a 2-byte format at the volume level — the 4/8/16-byte slab math is covered at the micro-tile level but not end-to-end extents.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336664860 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9674#issuecomment-6336664860). Originally posted by [fogydes](https://github.com/fogydes) on 2026-10-22T08:47:29Z. --- Reviewed; the mode-19 volume layout itself checks out. The math I recomputed matches the addrlib `ADDR_THICK` family: 8x8x4 micro tiles, the three element-size orders written into the equation bits (z-bits 4/3/2 depending on bytes per element), depth padded to 4 with level-major `×4` slab factors, slabs = ceil(depth/4), and the bijectivity test exercises all five element sizes — the 5120/2048/4096 extents recompute correctly for the tested depth values. Sources are cited properly and throws are kept for GB_TILE_MODE 15, 20-26 and block-compressed volumes. The conflict with today's main (both hunks in `Graphics/src/State.cpp`' `decodeDepth`) is measured, and the rebase also collides with main's rewrite of the "Depth planes in guest memory" debt entry — main moved on the exact prose this PR touches. Two gaps to close before this is trustworthy beyond the game run: 1. **The debt entry's last sentence is now false on this same branch.** "GcnDetile.cpp runs the GPU detiler over every mode that does not throw" — but the branch's `GcnDetile.cpp` mode list is exactly `{kGcnThin1D, kGcnDisplay1D, kGcnDisplay2D, kGcnThin2D, kGcnDepth2D64, kGcnDepth2D256, kGcnDepth2D1K, kGcnDisplayPrt, kGcnThin2DPrt, kGcnDepthPrt256}`; `kGcnThick1D` is missing, and neither that file nor `TextureDetiler` tests gained a case, while the detiler gate now admits the mode. Either add a mode-19 GPU detile/retile case (the honest fix — the mode exists in the fence-style gate, so the device path will run it) or scope the debt sentence to the modes it actually covers. 2. **A non-3D descriptor in tile mode 19 silently produces wrong offsets.** `describeGcnSurface` diverts to the volume path only when `dimension == k3D && IsGcnThick(...)`, and `IsGcnMacroTiled` returns false for `kGcnThick1D` — so a 2D/2DArray/1DArray/cube T# in mode 19 falls through to the generic GCN layout, which sizes each layer as a thin slice (no `×4` slab factor, no 8x8x4 z-interleave inside a 4-slice chunk). On hardware `Array1DTiledThick` still groups slices into 4-slice chunks, so the layers of the first chunk would interleave in guest memory and the generic path would detile them from wrong offsets. No tested or known title hits it (only the 3D case from the title run is recorded), but "silent wrong answer for an untested descriptor shape" is worse than throwing: if the cited sources say those dimensions cannot carry mode 19, make it throw and record it; if they can, this needs the volume path extended to layered layouts. Right now it's neither. Also worth one more test row when convenient: the new `gcnThickTilingTests` only pin a 2-byte format at the volume level — the 4/8/16-byte slab math is covered at the micro-tile level but not end-to-end extents.
MarcZX10 commented 2026-10-22 08:57:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T08:57:37Z.

Review: CHANGES_REQUESTED


The isolated feature commit adds focused thick-layout cases, and the block equations/depth slab offsets are clearly described. Current-main conventions and git diff --check pass. The PR is currently CONFLICTING with main; its declared dependency #9431 is also conflicting.

Because this changes the AGC driver, CONTRIBUTING requires paired focused tests on main and the change with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, and ANYPS5_REQUIRE_VULKAN=1, using ctest -V on the same machine/GPU. Please confirm the layer loaded, compare the logs for new VUID- errors, and record the GPU on the checklist. The reported Windows/NVIDIA agc_driver_graphics, agc_driver_gcn_detile, and Gang Beasts runs are useful, but no paired validation-layer output or VUID comparison is provided. Please coordinate/rebase after #9431 is resolved and rerun these checks on the current merge commit.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5611659099 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9674#pullrequestreview-5611659099). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T08:57:37Z. **Review:** CHANGES_REQUESTED --- The isolated feature commit adds focused thick-layout cases, and the block equations/depth slab offsets are clearly described. Current-main conventions and `git diff --check` pass. The PR is currently `CONFLICTING` with `main`; its declared dependency #9431 is also conflicting. Because this changes the AGC driver, CONTRIBUTING requires paired focused tests on `main` and the change with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, and `ANYPS5_REQUIRE_VULKAN=1`, using `ctest -V` on the same machine/GPU. Please confirm the layer loaded, compare the logs for new `VUID-` errors, and record the GPU on the checklist. The reported Windows/NVIDIA `agc_driver_graphics`, `agc_driver_gcn_detile`, and Gang Beasts runs are useful, but no paired validation-layer output or VUID comparison is provided. Please coordinate/rebase after #9431 is resolved and rerun these checks on the current merge commit.
ntamas94 commented 2026-10-22 10:13:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-10-22T10:13:53Z.


Thanks. The conflict is #9431's (Graphics/src/State.cpp); I will rebase once Get-fix has rebased #9431 and rerun the checks. Paired validation-layer run, now in the description: main (100% tests passed, main build 7e2ba73e4) and this branch (100% tests passed) with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 and VK_LOADER_DEBUG=warn,error, ctest -V, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200), Vulkan SDK 1.4.363.0: both logs carry the loader's adding layers "VK_LAYER_KHRONOS_validation" line (78 and 2 times) and neither reports was not found but was requested by env var VK_INSTANCE_LAYERS; VUID- ids on main: 0, on this branch: 0, new on this branch: 0.

On fogydes's two points, I will take both with the rebase: scope the debt sentence to the modes GcnDetile.cpp covers (or add a mode-19 case to it), and make a non-3D descriptor in tile mode 19 throw instead of taking the thin layout, with a debt sentence that layered thick surfaces are not laid out.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6338282497 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9674#issuecomment-6338282497). Originally posted by [ntamas94](https://github.com/ntamas94) on 2026-10-22T10:13:53Z. --- Thanks. The conflict is #9431's (`Graphics/src/State.cpp`); I will rebase once Get-fix has rebased #9431 and rerun the checks. Paired validation-layer run, now in the description: `main` (100% tests passed, main build 7e2ba73e4) and this branch (100% tests passed) with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1` and `VK_LOADER_DEBUG=warn,error`, `ctest -V`, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200), Vulkan SDK 1.4.363.0: both logs carry the loader's `adding layers "VK_LAYER_KHRONOS_validation"` line (78 and 2 times) and neither reports `was not found but was requested by env var VK_INSTANCE_LAYERS`; `VUID-` ids on `main`: 0, on this branch: 0, new on this branch: 0. On fogydes's two points, I will take both with the rebase: scope the debt sentence to the modes `GcnDetile.cpp` covers (or add a mode-19 case to it), and make a non-3D descriptor in tile mode 19 throw instead of taking the thin layout, with a debt sentence that layered thick surfaces are not laid out. AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-22 12:31:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T12:31:32Z.

Review: CHANGES_REQUESTED


The updated description now includes the paired validation-layer report requested in the earlier review; I have noted the same-machine GPU/driver details and the explanation that the focused State.cpp decode test itself creates no Vulkan instance. The current-main diff check is clean. I found a separate address-layout defect in the new 3D volume path.

DescribeSurface uses the shared SurfaceGeometry layer addressing consumed by Texture.cpp and ShaderResources.cpp: every mip access is computed as GuestLayerOffset(layer) + mip.tiledOffset, and GuestLayerOffset uses one geometry.layerBytes stride for every mip. describeGcnVolume instead lays each mip out level-major across all of that mip's slabs (mip.tiledOffset advances by mip.tiledSize * slabs) but sets geometry.layerBytes to only geometry.mips[0].tiledSize. That shared stride is correct only for mip 0. For example, with depth 32 and blockDepth 4, mip 1 still has depth 16 and therefore four slabs; its second slab is addressed using mip 0's slab size rather than mip 1's. This can address the wrong region or overlap other levels. The existing volume test uses depth 8, so mip 1 has only one slab and does not exercise this case.

Please make the address layout consistent with the existing shared callers (for example, slab-major storage with each mip's offsets inside the slab, or update the geometry/callers to carry a mip-specific slab stride) and add a multi-mip volume regression with depth at least 32 that checks all live slice/mip offsets are in range and non-overlapping. I did not run local C++ tests because no build tree is configured and the root filesystem has no free space.

The PR also remains stacked on #9431 and conflicts with current main in AgcDriver CMake. Its Gang Beasts run is reported from the earlier Get-fix branch, not current main. Please rebase/coordinate after the dependency is ready and verify the title stop on current main with a log before treating the title-specific intake evidence as complete.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5614158088 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9674#pullrequestreview-5614158088). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T12:31:32Z. **Review:** CHANGES_REQUESTED --- The updated description now includes the paired validation-layer report requested in the earlier review; I have noted the same-machine GPU/driver details and the explanation that the focused State.cpp decode test itself creates no Vulkan instance. The current-main diff check is clean. I found a separate address-layout defect in the new 3D volume path. DescribeSurface uses the shared SurfaceGeometry layer addressing consumed by Texture.cpp and ShaderResources.cpp: every mip access is computed as GuestLayerOffset(layer) + mip.tiledOffset, and GuestLayerOffset uses one geometry.layerBytes stride for every mip. describeGcnVolume instead lays each mip out level-major across all of that mip's slabs (mip.tiledOffset advances by mip.tiledSize * slabs) but sets geometry.layerBytes to only geometry.mips[0].tiledSize. That shared stride is correct only for mip 0. For example, with depth 32 and blockDepth 4, mip 1 still has depth 16 and therefore four slabs; its second slab is addressed using mip 0's slab size rather than mip 1's. This can address the wrong region or overlap other levels. The existing volume test uses depth 8, so mip 1 has only one slab and does not exercise this case. Please make the address layout consistent with the existing shared callers (for example, slab-major storage with each mip's offsets inside the slab, or update the geometry/callers to carry a mip-specific slab stride) and add a multi-mip volume regression with depth at least 32 that checks all live slice/mip offsets are in range and non-overlapping. I did not run local C++ tests because no build tree is configured and the root filesystem has no free space. The PR also remains stacked on #9431 and conflicts with current main in AgcDriver CMake. Its Gang Beasts run is reported from the earlier Get-fix branch, not current main. Please rebase/coordinate after the dependency is ready and verify the title stop on current main with a log before treating the title-specific intake evidence as complete.
ntamas94 commented 2026-10-22 13:21:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-10-22T13:21:57Z.


Rebased onto #9431's new head (26d651d3e, on main 7e2ba73e4) without conflicts. MarcZX10's layout finding and fogydes's two points are in the commit now.

The layout: describeGcnVolume is level-major on purpose, since addrlib stores a thick 3D mip chain level by level with each level's slabs together, and that is what the detiler reads. The inconsistent part was the shared callers: nine sites in StorageTexture and the write evidence computed GuestLayerOffset(layer) + mip.tiledOffset with level 0's slab stride for every level. They now use SurfaceGeometry::GuestOffset(layer, mip), which carries the level-major stride and was already what the sampled upload used; for every non-level-major geometry the two are identical, so the PS5 paths do not change. A storage image of a level-major surface also throws at creation (Texture.cpp, the rule #9431 added), so the stride was not reachable for a volume with mips, which the debt entry now records. The regression lays out a 32x32x32 volume with four levels (8, 4, 2 and 1 slabs) and checks that every slice's slab offset is inside the surface, that the slabs are disjoint and fill it exactly, and that level 1's second slab is one level-1 slab after its first.

fogydes's points:

  • a thick mode on a 1D-array, 2D, 2D-array or cube T# throws (PS4 thick tile modes are only implemented for 3D textures) instead of taking the thin layout; a TextureTiling case checks the refusal, and the debt entry says so;
  • the debt sentence about GcnDetile.cpp now says it runs the GPU detiler over the thin and depth modes, and that tile mode 19 is checked against the layout tests only, not on the GPU.

agc_driver_graphics and agc_driver_gcn_detile pass. Paired validation-layer run, now in the description: main (100% tests passed, main build 7e2ba73e4) and this branch (100% tests passed out of 2) with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 and VK_LOADER_DEBUG=warn,error, ctest -V, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200), Vulkan SDK 1.4.363.0: both logs carry the loader's adding layers "VK_LAYER_KHRONOS_validation" line (78 and 2 times) and neither reports was not found but was requested by env var VK_INSTANCE_LAYERS; VUID- ids on main: 0, on this branch: 0, new on this branch: 0. The Gang Beasts run reported so far is from the Get-fix bring-up branch; a run of the title on this stack over current main, with its log, follows separately.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6341815456 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9674#issuecomment-6341815456). Originally posted by [ntamas94](https://github.com/ntamas94) on 2026-10-22T13:21:57Z. --- Rebased onto #9431's new head (`26d651d3e`, on `main` `7e2ba73e4`) without conflicts. MarcZX10's layout finding and fogydes's two points are in the commit now. The layout: `describeGcnVolume` is level-major on purpose, since addrlib stores a thick 3D mip chain level by level with each level's slabs together, and that is what the detiler reads. The inconsistent part was the shared callers: nine sites in `StorageTexture` and the write evidence computed `GuestLayerOffset(layer) + mip.tiledOffset` with level 0's slab stride for every level. They now use `SurfaceGeometry::GuestOffset(layer, mip)`, which carries the level-major stride and was already what the sampled upload used; for every non-level-major geometry the two are identical, so the PS5 paths do not change. A storage image of a level-major surface also throws at creation (`Texture.cpp`, the rule #9431 added), so the stride was not reachable for a volume with mips, which the debt entry now records. The regression lays out a 32x32x32 volume with four levels (8, 4, 2 and 1 slabs) and checks that every slice's slab offset is inside the surface, that the slabs are disjoint and fill it exactly, and that level 1's second slab is one level-1 slab after its first. fogydes's points: - a thick mode on a 1D-array, 2D, 2D-array or cube T# throws (`PS4 thick tile modes are only implemented for 3D textures`) instead of taking the thin layout; a `TextureTiling` case checks the refusal, and the debt entry says so; - the debt sentence about `GcnDetile.cpp` now says it runs the GPU detiler over the thin and depth modes, and that tile mode 19 is checked against the layout tests only, not on the GPU. `agc_driver_graphics` and `agc_driver_gcn_detile` pass. Paired validation-layer run, now in the description: `main` (100% tests passed, main build 7e2ba73e4) and this branch (100% tests passed out of 2) with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1` and `VK_LOADER_DEBUG=warn,error`, `ctest -V`, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200), Vulkan SDK 1.4.363.0: both logs carry the loader's `adding layers "VK_LAYER_KHRONOS_validation"` line (78 and 2 times) and neither reports `was not found but was requested by env var VK_INSTANCE_LAYERS`; `VUID-` ids on `main`: 0, on this branch: 0, new on this branch: 0. The Gang Beasts run reported so far is from the Get-fix bring-up branch; a run of the title on this stack over current `main`, with its log, follows separately. AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
XairRrR commented 2026-10-29 10:33:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T10:33:08Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The tile mode 19 layout, the GuestOffset(layer, mip) call-site fix and the new tests build and pass on a merge with current main, but mip levels with fewer than four slices are laid out thick, while addrlib lays them out 1D thin.

What I ran

  • Head: 356cb639efda2c267986b1e926744fa1f0999d8e
  • main: beb5e23f8fd792c95b32a8b729ba73dfcf98772c
  • The head merged into main with --no-ff, with no conflicts (docs/dev/debt/libSceAgcDriver.md auto-merged).
  • Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Release build with BUILD_TESTING=ON.
git diff --check origin/main...refs/review/9674
python3 tools/check_conventions.py --base origin/main
cmake --build build -j10 --target agc_driver_graphics_tests agc_driver_gcn_detile_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -R '^(agc_driver_graphics|agc_driver_gcn_detile)$' -V --output-on-failure -j4
# same build and ctest on origin/main, same worktree and GPU
# negative controls: see below
# probe: a temporary block in tests/TextureTiling.cpp that printed DescribeSurface() of a 32x32x32, 6-level, format-20 volume (reverted afterwards)

Results

Check Result
Merge with main clean
git diff --check clean
check_conventions.py --base origin/main All conventions checks passed.
Build of agc_driver_graphics_tests, agc_driver_gcn_detile_tests OK
agc_driver_graphics, merged tree Passed (5.70 s)
agc_driver_gcn_detile, merged tree Passed (1.07 s)
Same two tests on main both Passed (agc_driver_graphics 6.23 s)
VUID- lines, main / merged 0 / 0
was not found but was requested by env var VK_INSTANCE_LAYERS absent in both logs
Validation layer loaded yes in both logs (Insert instance layer "VK_LAYER_KHRONOS_validation", once each; it comes from agc_driver_gcn_detile, since agc_driver_graphics runs on a mock Vulkan)
Merged-tree ctest excerpt
1127: [Vulkan Loader] WARNING | LAYER: env var 'VK_INSTANCE_LAYERS' defined and adding layers "VK_LAYER_KHRONOS_validation"
1127: [Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_KHRONOS_validation" (/usr/lib/libVkLayer_khronos_validation.so)
1/2 Test #1127: agc_driver_gcn_detile ............   Passed    1.07 sec
950: Graphics validation tests passed
2/2 Test  #950: agc_driver_graphics ..............   Passed    5.70 sec
100% tests passed out of 2
Probe: DescribeSurface() of a 32x32x32 volume, 6 levels, format 20 (4 bytes), gcnPitch 32
PROBE level 0 offset 0 tiledSize 16384 blocksPerRow 4
PROBE level 1 offset 131072 tiledSize 4096 blocksPerRow 2
PROBE level 2 offset 147456 tiledSize 1024 blocksPerRow 1
PROBE level 3 offset 149504 tiledSize 1024 blocksPerRow 1
PROBE level 4 offset 150528 tiledSize 1024 blocksPerRow 1
PROBE level 5 offset 151552 tiledSize 1024 blocksPerRow 1
PROBE guestBytes 152576

Negative control

  1. I restored all seven production files from origin/main and kept the PR's test file: agc_driver_graphics_tests no longer compiles (kGcnThick1D is not a member of TextureTileMode, tests/TextureTiling.cpp:201 and :227). That only shows the tests depend on the new enum value, so I ran a second control.
  2. On the merged tree I undid only the thick ? layer / blockDepth : layer change in SurfaceGeometry::GuestOffset (Graphics/include/TextureTiling.hpp:74) and rebuilt: agc_driver_graphics fails with AGC graphics: PS4 thick volume slab offset is misplaced. The new volume cases do catch a wrong per-level slab stride. I restored the file afterwards.

Findings

Blocking

  1. Mip levels with fewer than four slices are laid out thick, but addrlib degrades them to 1D thin. describeGcnVolume gives every level an 8x8x4 micro tile (TextureTiling.cpp:603), ceil(depth / 4) slabs (:596) and the thick element order. For mipLevel > 0, addrlib's EgBasedLib::ComputeSurfaceInfoMicroTiled switches ADDR_TM_1D_TILED_THICK to ADDR_TM_1D_TILED_THIN1 when the level has fewer than ThickTileThickness (4) slices, and sets the thickness to 1. Such a level uses 8x8 thin micro tiles, one physical slice per depth slice. On SI the pitch also grows until a slice is a multiple of the 256-byte base alignment (SiLib::HwlGetSizeAdjustmentMicroTiled).
    • Concrete case (probe above): in a 32x32x32 32-bit volume with a full chain, level 4 (2x2x2) is one 1024-byte thick slab here. Addrlib lays it out as two 256-byte thin slices (512 bytes), and level 5 (1x1x1) as 256 bytes instead of 1024. Element (0,0,z=1) of level 4 is at byte 32 of the level here (z0 is element-index bit 3 at 4 bytes per element) and at byte 256 in addrlib. guestBytes is 152576 here and 151296 in addrlib. Any volume with a level whose depth is 1 or 2 is hit. A full mip chain always ends in such levels, and so does a short chain on a shallow volume, such as a 16x16x4 volume with 2 levels.
    • This is valid input that is now read silently from wrong offsets. Before this PR it threw. The new 4-level 32x32x32 test (tests/TextureTiling.cpp:236-241) stops at depth 4, so it cannot catch this.
    • Suggested fix: lay out a level with level > 0 && levelDepth < 4 as 1D thin. That means a per-level thickness: GuestOffset and the thick flag passed to the detiler must use one-slice strides and the thin micro tile for that level, perhaps through mip.gcnMicroTiled and MipTileMode. The level also needs the SI pitch adjustment. If that is too much for this PR, Require against such levels so they throw, record the gap in the "PS4 (GCN) thick and layered surfaces" debt entry, and add a test with a full chain (for example 32x32x32 with 6 levels, or 16x16x4 with 2 levels) that pins whichever behaviour is chosen.

Non-blocking

  1. The description says the layout was "checked against addrlib". The degrade above is the one part of the addrlib micro-tiled path that differs, so please say in the description and the debt entry how levels under four slices are handled once the fix is in.
  2. Confirming fogydes's earlier point and MarcZX10's: the per-level slab stride is fixed at this head. All nine StorageTexture and write-evidence sites and ShaderResources.cpp:1177 now use GuestOffset(layer, mip), and the second negative control shows the new test fails without it. The paired validation run only exercises agc_driver_gcn_detile, which has no tile mode 19 case, as the debt entry says. So the GPU detiler still has not run tile mode 19 on any device. A mode-19 case in GcnDetile.cpp would let the shader's slice << 24 z input be checked against the equation.

Not verified

  • Behaviour on a PS4 console, and whether Sony's GpuAddress library applies the same thin degrade as addrlib. I compared against addrlib only, which the PR names as its reference.
  • Gang Beasts (CUSA04865). I launch no titles, and the author says the title has not been rerun on current main.
  • Windows. Only Linux was built and run here.
  • The full test suite, which was not run.

To get this to a good state

  1. Handle mip levels with fewer than four slices as addrlib does (1D thin, one slice per depth slice, SI pitch adjustment), or make them throw and record the gap in the debt entry.
  2. Add a TextureTiling case with a mip chain that reaches depth 1 or 2, so the chosen behaviour is pinned.
  3. Rerun agc_driver_graphics, agc_driver_gcn_detile and the paired validation run on the updated head.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696282414 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9674#pullrequestreview-5696282414). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T10:33:08Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The tile mode 19 layout, the `GuestOffset(layer, mip)` call-site fix and the new tests build and pass on a merge with current `main`, but mip levels with fewer than four slices are laid out thick, while addrlib lays them out 1D thin. ## What I ran - Head: `356cb639efda2c267986b1e926744fa1f0999d8e` - `main`: `beb5e23f8fd792c95b32a8b729ba73dfcf98772c` - The head merged into `main` with `--no-ff`, with no conflicts (`docs/dev/debt/libSceAgcDriver.md` auto-merged). - Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Release build with `BUILD_TESTING=ON`. ```sh git diff --check origin/main...refs/review/9674 python3 tools/check_conventions.py --base origin/main cmake --build build -j10 --target agc_driver_graphics_tests agc_driver_gcn_detile_tests VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -R '^(agc_driver_graphics|agc_driver_gcn_detile)$' -V --output-on-failure -j4 # same build and ctest on origin/main, same worktree and GPU # negative controls: see below # probe: a temporary block in tests/TextureTiling.cpp that printed DescribeSurface() of a 32x32x32, 6-level, format-20 volume (reverted afterwards) ``` ## Results | Check | Result | |---|---| | Merge with `main` | clean | | `git diff --check` | clean | | `check_conventions.py --base origin/main` | `All conventions checks passed.` | | Build of `agc_driver_graphics_tests`, `agc_driver_gcn_detile_tests` | OK | | `agc_driver_graphics`, merged tree | Passed (5.70 s) | | `agc_driver_gcn_detile`, merged tree | Passed (1.07 s) | | Same two tests on `main` | both Passed (`agc_driver_graphics` 6.23 s) | | `VUID-` lines, `main` / merged | 0 / 0 | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | absent in both logs | | Validation layer loaded | yes in both logs (`Insert instance layer "VK_LAYER_KHRONOS_validation"`, once each; it comes from `agc_driver_gcn_detile`, since `agc_driver_graphics` runs on a mock Vulkan) | <details><summary>Merged-tree ctest excerpt</summary> ``` 1127: [Vulkan Loader] WARNING | LAYER: env var 'VK_INSTANCE_LAYERS' defined and adding layers "VK_LAYER_KHRONOS_validation" 1127: [Vulkan Loader] INFO | LAYER: Insert instance layer "VK_LAYER_KHRONOS_validation" (/usr/lib/libVkLayer_khronos_validation.so) 1/2 Test #1127: agc_driver_gcn_detile ............ Passed 1.07 sec 950: Graphics validation tests passed 2/2 Test #950: agc_driver_graphics .............. Passed 5.70 sec 100% tests passed out of 2 ``` </details> <details><summary>Probe: DescribeSurface() of a 32x32x32 volume, 6 levels, format 20 (4 bytes), gcnPitch 32</summary> ``` PROBE level 0 offset 0 tiledSize 16384 blocksPerRow 4 PROBE level 1 offset 131072 tiledSize 4096 blocksPerRow 2 PROBE level 2 offset 147456 tiledSize 1024 blocksPerRow 1 PROBE level 3 offset 149504 tiledSize 1024 blocksPerRow 1 PROBE level 4 offset 150528 tiledSize 1024 blocksPerRow 1 PROBE level 5 offset 151552 tiledSize 1024 blocksPerRow 1 PROBE guestBytes 152576 ``` </details> ## Negative control 1. I restored all seven production files from `origin/main` and kept the PR's test file: `agc_driver_graphics_tests` no longer compiles (`kGcnThick1D` is not a member of `TextureTileMode`, `tests/TextureTiling.cpp:201` and `:227`). That only shows the tests depend on the new enum value, so I ran a second control. 2. On the merged tree I undid only the `thick ? layer / blockDepth : layer` change in `SurfaceGeometry::GuestOffset` (`Graphics/include/TextureTiling.hpp:74`) and rebuilt: `agc_driver_graphics` fails with `AGC graphics: PS4 thick volume slab offset is misplaced`. The new volume cases do catch a wrong per-level slab stride. I restored the file afterwards. ## Findings ### Blocking 1. **Mip levels with fewer than four slices are laid out thick, but addrlib degrades them to 1D thin.** [`describeGcnVolume`](https://github.com/boykopovar/AnyPS5/blob/356cb639efda2c267986b1e926744fa1f0999d8e/core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp#L585-L609) gives every level an 8x8x4 micro tile (`TextureTiling.cpp:603`), `ceil(depth / 4)` slabs (`:596`) and the thick element order. For `mipLevel > 0`, addrlib's [`EgBasedLib::ComputeSurfaceInfoMicroTiled`](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-24.0.0/src/amd/addrlib/src/r800/egbaddrlib.cpp#L358-373) switches `ADDR_TM_1D_TILED_THICK` to [`ADDR_TM_1D_TILED_THIN1`](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-24.0.0/src/amd/addrlib/src/r800/egbaddrlib.cpp#L1229-1232) when the level has fewer than `ThickTileThickness` (4) slices, and sets the thickness to 1. Such a level uses 8x8 thin micro tiles, one physical slice per depth slice. On SI the pitch also grows until a slice is a multiple of the 256-byte base alignment ([`SiLib::HwlGetSizeAdjustmentMicroTiled`](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-24.0.0/src/amd/addrlib/src/r800/siaddrlib.cpp#L1839-1851)). - Concrete case (probe above): in a 32x32x32 32-bit volume with a full chain, level 4 (2x2x2) is one 1024-byte thick slab here. Addrlib lays it out as two 256-byte thin slices (512 bytes), and level 5 (1x1x1) as 256 bytes instead of 1024. Element (0,0,z=1) of level 4 is at byte 32 of the level here (z0 is element-index bit 3 at 4 bytes per element) and at byte 256 in addrlib. `guestBytes` is 152576 here and 151296 in addrlib. Any volume with a level whose depth is 1 or 2 is hit. A full mip chain always ends in such levels, and so does a short chain on a shallow volume, such as a 16x16x4 volume with 2 levels. - This is valid input that is now read silently from wrong offsets. Before this PR it threw. The new 4-level 32x32x32 test ([`tests/TextureTiling.cpp:236-241`](https://github.com/boykopovar/AnyPS5/blob/356cb639efda2c267986b1e926744fa1f0999d8e/core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp#L236-L241)) stops at depth 4, so it cannot catch this. - Suggested fix: lay out a level with `level > 0 && levelDepth < 4` as 1D thin. That means a per-level thickness: `GuestOffset` and the `thick` flag passed to the detiler must use one-slice strides and the thin micro tile for that level, perhaps through `mip.gcnMicroTiled` and `MipTileMode`. The level also needs the SI pitch adjustment. If that is too much for this PR, `Require` against such levels so they throw, record the gap in the "PS4 (GCN) thick and layered surfaces" debt entry, and add a test with a full chain (for example 32x32x32 with 6 levels, or 16x16x4 with 2 levels) that pins whichever behaviour is chosen. ### Non-blocking 1. The description says the layout was "checked against addrlib". The degrade above is the one part of the addrlib micro-tiled path that differs, so please say in the description and the [debt entry](https://github.com/boykopovar/AnyPS5/blob/356cb639efda2c267986b1e926744fa1f0999d8e/docs/dev/debt/libSceAgcDriver.md#L80) how levels under four slices are handled once the fix is in. 2. Confirming fogydes's earlier point and MarcZX10's: the per-level slab stride is fixed at this head. All nine `StorageTexture` and write-evidence sites and `ShaderResources.cpp:1177` now use `GuestOffset(layer, mip)`, and the second negative control shows the new test fails without it. The paired validation run only exercises `agc_driver_gcn_detile`, which has no tile mode 19 case, as the debt entry says. So the GPU detiler still has not run tile mode 19 on any device. A mode-19 case in `GcnDetile.cpp` would let the shader's `slice << 24` z input be checked against the equation. ## Not verified - Behaviour on a PS4 console, and whether Sony's GpuAddress library applies the same thin degrade as addrlib. I compared against addrlib only, which the PR names as its reference. - Gang Beasts (CUSA04865). I launch no titles, and the author says the title has not been rerun on current `main`. - Windows. Only Linux was built and run here. - The full test suite, which was not run. ## To get this to a good state 1. Handle mip levels with fewer than four slices as addrlib does (1D thin, one slice per depth slice, SI pitch adjustment), or make them throw and record the gap in the debt entry. 2. Add a `TextureTiling` case with a mip chain that reaches depth 1 or 2, so the chosen behaviour is pinned. 3. Rerun `agc_driver_graphics`, `agc_driver_gcn_detile` and the paired validation run on the updated head.
MarcZX10 commented 2026-10-29 10:59:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T10:59:55Z.

Review: APPROVED


Re-reviewed exact head 356cb639efda2c267986b1e926744fa1f0999d8e against current main d2b15d8802. The follow-up addresses the earlier level-major addressing defect: all guest-memory texture consumers now use GuestOffset(layer, mip), and the depth-32/four-mip test checks every live slab is in range, non-overlapping, and uses the correct level-1 slab stride. Removing the unsupported 2D-array throwing assertion is also appropriate; the code still documents that layout as unimplemented.\n\nThe merge preview is clean; since the tested base f7e84c4c only the debt document changed among this PR’s paths. The author reports agc_driver_graphics and agc_driver_gcn_detile passing three runs each, plus paired Khronos-validation runs with the layer loaded and zero VUIDs. Current-head conventions and whitespace checks pass; hosted Windows passes, while product Linux and specialized jobs are skipped. I did not run local GPU tests. The Gang Beasts title result remains historical and was not rerun on this head; the review covers the code/tests and paired validation report, not a fresh title result.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696618966 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9674#pullrequestreview-5696618966). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T10:59:55Z. **Review:** APPROVED --- Re-reviewed exact head `356cb639efda2c267986b1e926744fa1f0999d8e` against current `main` `d2b15d8802`. The follow-up addresses the earlier level-major addressing defect: all guest-memory texture consumers now use `GuestOffset(layer, mip)`, and the depth-32/four-mip test checks every live slab is in range, non-overlapping, and uses the correct level-1 slab stride. Removing the unsupported 2D-array throwing assertion is also appropriate; the code still documents that layout as unimplemented.\n\nThe merge preview is clean; since the tested base `f7e84c4c` only the debt document changed among this PR’s paths. The author reports `agc_driver_graphics` and `agc_driver_gcn_detile` passing three runs each, plus paired Khronos-validation runs with the layer loaded and zero VUIDs. Current-head conventions and whitespace checks pass; hosted Windows passes, while product Linux and specialized jobs are skipped. I did not run local GPU tests. The Gang Beasts title result remains historical and was not rerun on this head; the review covers the code/tests and paired validation report, not a fresh title result.
MarcZX10 commented 2026-10-31 14:08:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T14:08:43Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

The current head still allocates each sub-four-slice mip as a full four-slice thick slab, which disagrees with the reported addrlib layout and leaves the PR's central layout claim incomplete.

What I ran

  • Reviewed head 297118f83bccf69aeef9fbe54a51a15d4feaef81 against base 7d9a2fc71384722a0bf8101a60602c7db1fbe972; PR base is main. The precheck's merge preview was clean and its final snapshot confirmed the head and base did not change.
  • Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0, Git 2.39.5.
git diff --check 7d9a2fc71384722a0bf8101a60602c7db1fbe972...297118f83bccf69aeef9fbe54a51a15d4feaef81
python3 tools/check_conventions.py --base 7d9a2fc71384722a0bf8101a60602c7db1fbe972 --head 297118f83bccf69aeef9fbe54a51a15d4feaef81
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 9674

The diff check and conventions passed. The precheck's ABI audit and test-quality helper could not run because those helper scripts are absent from the isolated PR checkout; these are tooling-availability failures, not findings against the PR. I did not build or run the C++ tests.

Results

Check Result
Diff check Passed
Repository conventions and PR template Passed
Live mergeability preview Passed; clean
Hosted Windows Passed at this head
Hosted Linux and specialized jobs Skipped by workflow
ABI audit / test-quality helper Not executable: helper files absent from isolated checkout
Local C++ build and tests Not run

The author's comment reports paired GPU runs and a harness for this head; those are author-reported results, not runs I performed. The reported agc_driver_graphics and agc_driver_gcn_detile suites passed, but the author also reports that the harness still gets guestBytes=152576 and per-level allocations of 1024 bytes at depths 2 and 1.

Findings

Blocking

describeGcnVolume() computes slabs = (levelDepth + 3) / 4, but sets every mip's tiledSize to rowElements * rows * 4 * bytes. As a result, a mip with depth 2 or 1 still reserves a full four-slice slab. The author-reported harness says this remains true on the current head and differs from addrlib's thin layout for those levels; the earlier review on this PR also documents the same mismatch. This means full mip chains can have incorrect offsets and guest size even though the current deep-volume test passes, since that test expects four-slice padding. Please either implement the correct thin layout for sub-four-slice mip levels, or reject those mip chains until supported; add a regression case that reaches depth 2 and 1 (for example a 32×32×32 volume with six mip levels) and verifies the expected offsets and total size.

Sources

  • Current implementation at the reviewed head: describeGcnVolume().
  • Prior detailed report of the same mip-depth mismatch: XairRrR's review.
  • Current-head harness and paired-run report supplied by the PR author: comment.

Not verified

I did not run a local C++ build, the C++ test suites, Linux tests, validation-layer checks, or console behavior. The reported GPU runs are functional-only and state that no Vulkan validation layer was available.

To get this to a good state

Please implement or explicitly reject the sub-four-slice mip case and add a regression test for the depth-2/depth-1 levels. I will rerun the same relevant checks and review the new exact head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5723124025 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9674#pullrequestreview-5723124025). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T14:08:43Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested The current head still allocates each sub-four-slice mip as a full four-slice thick slab, which disagrees with the reported addrlib layout and leaves the PR's central layout claim incomplete. ## What I ran - Reviewed head `297118f83bccf69aeef9fbe54a51a15d4feaef81` against base `7d9a2fc71384722a0bf8101a60602c7db1fbe972`; PR base is `main`. The precheck's merge preview was clean and its final snapshot confirmed the head and base did not change. - Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0, Git 2.39.5. ```sh git diff --check 7d9a2fc71384722a0bf8101a60602c7db1fbe972...297118f83bccf69aeef9fbe54a51a15d4feaef81 python3 tools/check_conventions.py --base 7d9a2fc71384722a0bf8101a60602c7db1fbe972 --head 297118f83bccf69aeef9fbe54a51a15d4feaef81 python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 9674 ``` The diff check and conventions passed. The precheck's ABI audit and test-quality helper could not run because those helper scripts are absent from the isolated PR checkout; these are tooling-availability failures, not findings against the PR. I did not build or run the C++ tests. ## Results | Check | Result | |---|---| | Diff check | Passed | | Repository conventions and PR template | Passed | | Live mergeability preview | Passed; clean | | Hosted Windows | Passed at this head | | Hosted Linux and specialized jobs | Skipped by workflow | | ABI audit / test-quality helper | Not executable: helper files absent from isolated checkout | | Local C++ build and tests | Not run | The author's comment reports paired GPU runs and a harness for this head; those are author-reported results, not runs I performed. The reported `agc_driver_graphics` and `agc_driver_gcn_detile` suites passed, but the author also reports that the harness still gets `guestBytes=152576` and per-level allocations of 1024 bytes at depths 2 and 1. ## Findings ### Blocking `describeGcnVolume()` computes `slabs = (levelDepth + 3) / 4`, but sets every mip's `tiledSize` to `rowElements * rows * 4 * bytes`. As a result, a mip with depth 2 or 1 still reserves a full four-slice slab. The author-reported harness says this remains true on the current head and differs from addrlib's thin layout for those levels; the earlier review on this PR also documents the same mismatch. This means full mip chains can have incorrect offsets and guest size even though the current deep-volume test passes, since that test expects four-slice padding. Please either implement the correct thin layout for sub-four-slice mip levels, or reject those mip chains until supported; add a regression case that reaches depth 2 and 1 (for example a 32×32×32 volume with six mip levels) and verifies the expected offsets and total size. ## Sources - Current implementation at the reviewed head: [`describeGcnVolume()`](https://github.com/boykopovar/AnyPS5/blob/297118f83bccf69aeef9fbe54a51a15d4feaef81/core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp#L578-L621). - Prior detailed report of the same mip-depth mismatch: [XairRrR's review](https://github.com/boykopovar/AnyPS5/pull/9674#pullrequestreview-5696282414). - Current-head harness and paired-run report supplied by the PR author: [comment](https://github.com/boykopovar/AnyPS5/pull/9674#issuecomment-6544328912). ## Not verified I did not run a local C++ build, the C++ test suites, Linux tests, validation-layer checks, or console behavior. The reported GPU runs are functional-only and state that no Vulkan validation layer was available. ## To get this to a good state Please implement or explicitly reject the sub-four-slice mip case and add a regression test for the depth-2/depth-1 levels. I will rerun the same relevant checks and review the new exact head.
XairRrR commented 2026-11-03 16:53:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T16:53:24Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

This pull request does not merge cleanly into main (1e658521a0): head 8f4a2856a2 conflicts in

  • docs/dev/debt/libSceAgcDriver.md

Please rebase it onto current main. I will review the change once it merges cleanly.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5756231038 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9674#pullrequestreview-5756231038). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T16:53:24Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested This pull request does not merge cleanly into `main` (1e658521a0a599872612bb91949311e2956b5283): head 8f4a2856a25736615ffd051e9859d8ebf275d79d conflicts in - `docs/dev/debt/libSceAgcDriver.md` Please rebase it onto current `main`. I will review the change once it merges cleanly. <!-- anyps5-bots job=3463 head=8f4a2856a25736615ffd051e9859d8ebf275d79d -->
XairRrR commented 2026-11-03 21:19:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T21:19:55Z.

Review: APPROVED


Re-checked — approved

Commit 9fde6efab2 resolves my one blocking finding: nonzero tile-mode-19 mip levels with fewer than four slices are now laid out as 1D thin, one slice per stride, with SI's 256-byte slice adjustment. A full-chain test pins this, and that test fails without the fix.

What changed since my last review

I last reviewed 356cb639ef. Since then:

  • Merges of main: 297118f83b shortens the debt entry, 8f4a2856a2 and 72d72c720d merge main, and cc596afba5 resolves a debt-file conflict.
  • 9fde6efab2, the fix:
    • describeGcnVolume sets thin = level != 0 && levelDepth < 4. A thin level gets thickness 1, one slab per slice, a pitch raised in steps of 8 until the slice is a multiple of 256 bytes, and mip.gcnMicroTiled = thin.
    • SurfaceGeometry::GuestOffset strides by single slices for such a level (Graphics/include/TextureTiling.hpp:74).
    • MipTileMode maps the level to kGcnThin1D (Graphics/include/TextureTiling.hpp:97).
    • TextureDetiler::Dispatch selects the thin pipeline for the level (Graphics/src/TextureDetiler.cpp:237).
    • New test cases cover a 32x32x32 six-level chain, the thin/thick mode selection, and the slice alignment at 8 and 16 bits.
    • The debt entry describes the degrade.
  • Description: a "Refresh" paragraph says the GPU detiler, paired validation and title runs were not redone on this head.

What I ran

Head 9fde6efab2b0af27a335af369a1b36b128169420, main 086c0686c8adff3ee648fdbe34e0b0b647e1d511, merged tree 9ed5d6e4cbfbb1215dbe9e64750343f79ed8b2de. Machine: Debian 13 VM, 2× Intel Xeon Gold 6136, GCC 14.2.0, Vulkan on lavapipe (Mesa 26.1.6, LLVM 19), no GPU.

git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...9fde6efab2b0af27a335af369a1b36b128169420
python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511
ctest --test-dir build -j8 --test-load 32 -R '^(agc_driver_graphics|agc_driver_gcn_detile)$' --output-on-failure
# negative control: Graphics/src/TextureTiling.cpp restored from cc596afba5 (the head just before the fix, with main already merged)
ninja -C build -j32 -l32 agc_driver_graphics_tests
ctest --test-dir build -R '^agc_driver_graphics$' --output-on-failure
# restored from the merged tree, rebuilt, re-ran: passed
# validation-ID attribution for agc_driver_image_gather_volume, on the merged tree and with all 8 PR files restored from main
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R '^agc_driver_image_gather_volume$'
git status --porcelain   # empty at the end
Check Result
git diff --check clean
check_conventions.py 0 errors, 1 warning: [debt-length] on docs/dev/debt/libSceAgcDriver.md:118 (1212 characters)
Build of the merged tree (script) OK
agc_driver_graphics Passed (34.9 s with -j8, 34.2 s alone)
agc_driver_gcn_detile Passed (3.6 s)
Tests the change can reach (script, 2182 run) 0 new failures, 0 timeouts; 7 known failures that also fail on main
Validation layer (script, 783 tests on lavapipe) layer loaded in 782 of 782 that create an instance; the only new IDs are in agc_driver_image_gather_volume and come from main (see below)

The new validation IDs come from main. build.json lists 4 VkSamplerCreateInfo IDs in agc_driver_image_gather_volume, a test the baseline did not run. The test uses no GCN tile mode. I ran it with the layer in two states:

Tree VUID lines
Merged tree 8
All 8 PR files restored from main 8, the same IDs
VUIDs, identical in both runs
      2 VUID-VkSamplerCreateInfo-addressModeU-01079
      2 VUID-VkSamplerCreateInfo-addressModeU-parameter
      2 VUID-VkSamplerCreateInfo-addressModeV-parameter
      2 VUID-VkSamplerCreateInfo-addressModeW-parameter

Negative control

I reverted only the layout part of the fix: Graphics/src/TextureTiling.cpp as it was at cc596afba5, keeping the new header, detiler and tests. agc_driver_graphics then fails with:

AGC graphics: PS4 full volume mip chain differs from addrlib

With the merged file restored it passes again. This confirms the author's harness result from the Refresh note. The test also checks GuestOffset(1, mips[4]) == 150784 and the MipTileMode selection, so it covers the header changes too.

I recomputed the pinned numbers by hand for a 32-bit 32³ chain:

Level Size Layout Bytes Ends at
0 32³ thick 131072 131072
1 16³ thick 16384 147456
2 8³ thick 2048 149504
3 4³ one thick 8x8x4 slab 1024 150528
4 2³ two thin 256-byte slices 512 151040
5 1³ one thin 256-byte slice 256 151296

151296 is the total I gave in my last review. The 8- and 16-bit cases need pitches of 32 and 16 elements to reach a 256-byte slice, both 32 bytes. That matches the test.

Previous findings

  • Blocking 1, shallow mip levels laid out thick: Resolved. Levels with level > 0 && levelDepth < 4 are 1D thin with single-slice strides and the SI pitch adjustment. The uploads and write-backs that go through Dispatch choose the thin pipeline for them. DispatchImage always asks for a non-thick pipeline, so it is unaffected. The new six-level test pins the layout, and it fails without the fix.
  • Non-blocking 1, "checked against addrlib" wording: Resolved. The description and the debt entry now say how levels under four slices are handled and name ComputeSurfaceInfoMicroTiled and HwlGetSizeAdjustmentMicroTiled.
  • Non-blocking 2, no GPU detile case for mode 19: Still open, non-blocking. GcnDetile.cpp still has no tile-mode-19 case, and the debt entry says so ("mode 19 has layout tests only"). Nothing on a device has run the thick shader path or the new thin-level pipeline choice.

New findings

Blocking

None.

Non-blocking

  1. The debt entry is over the length limit again. check_conventions.py warns that the entry has 1212 characters; the limit is 1000. 297118f83b had brought it under the limit, and 9fde6efab2 adds the degrade sentence. CONTRIBUTING asks entries to state the gap first. Suggested fix: cut the description of implemented behaviour, for example the 8x8x4 order and the degrade mechanics, down to the source names. Keep what is unchecked and what throws.
  2. The required validation and GPU evidence is from older heads. The Refresh note says agc_driver_graphics, the GPU detiler and the paired validation run were not rerun on this head. The GPUs tested line still refers to the earlier RTX 2080 runs. On lavapipe I found nothing new from this PR, but CONTRIBUTING asks the author to run the paired check for AGC driver changes. Please rerun it on the RTX 2080 and update the Tested section.
  3. agc_driver_graphics runs over 30 s here (34.2 s alone). The PR adds only small CPU cases, and TechLevelZero's NVIDIA runs already showed this test at about 30 s, so I don't count this against the PR. I did not measure main alone on this machine.

Not verified

  • No GPU run of the mode-19 thick or degraded-thin detile shader; no fixture exercises it.
  • Paired validation on a hardware GPU. Only lavapipe was run here.
  • Console behaviour, and whether Sony's GpuAddress library applies the same degrade as addrlib.
  • I checked addrlib's behaviour from my previous review's reading of the source. I did not re-read the addrlib source in this pass (no network).
  • Gang Beasts (CUSA04865). I launch no titles.
  • Windows.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5759627308 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9674#pullrequestreview-5759627308). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T21:19:55Z. **Review:** APPROVED --- # Re-checked — approved Commit 9fde6efab2 resolves my one blocking finding: nonzero tile-mode-19 mip levels with fewer than four slices are now laid out as 1D thin, one slice per stride, with SI's 256-byte slice adjustment. A full-chain test pins this, and that test fails without the fix. ## What changed since my last review I last reviewed `356cb639ef`. Since then: - **Merges of `main`:** 297118f83b shortens the debt entry, 8f4a2856a2 and 72d72c720d merge `main`, and cc596afba5 resolves a debt-file conflict. - **9fde6efab2, the fix:** - [`describeGcnVolume`](https://github.com/boykopovar/AnyPS5/blob/9fde6efab2b0af27a335af369a1b36b128169420/core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp#L596-L609) sets `thin = level != 0 && levelDepth < 4`. A thin level gets thickness 1, one slab per slice, a pitch raised in steps of 8 until the slice is a multiple of 256 bytes, and `mip.gcnMicroTiled = thin`. - `SurfaceGeometry::GuestOffset` strides by single slices for such a level (`Graphics/include/TextureTiling.hpp:74`). - `MipTileMode` maps the level to `kGcnThin1D` (`Graphics/include/TextureTiling.hpp:97`). - `TextureDetiler::Dispatch` selects the thin pipeline for the level (`Graphics/src/TextureDetiler.cpp:237`). - New [test cases](https://github.com/boykopovar/AnyPS5/blob/9fde6efab2b0af27a335af369a1b36b128169420/core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp#L261-L270) cover a 32x32x32 six-level chain, the thin/thick mode selection, and the slice alignment at 8 and 16 bits. - The debt entry describes the degrade. - **Description:** a "Refresh" paragraph says the GPU detiler, paired validation and title runs were not redone on this head. ## What I ran Head `9fde6efab2b0af27a335af369a1b36b128169420`, `main` `086c0686c8adff3ee648fdbe34e0b0b647e1d511`, merged tree `9ed5d6e4cbfbb1215dbe9e64750343f79ed8b2de`. Machine: Debian 13 VM, 2× Intel Xeon Gold 6136, GCC 14.2.0, Vulkan on lavapipe (Mesa 26.1.6, LLVM 19), no GPU. ```sh git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...9fde6efab2b0af27a335af369a1b36b128169420 python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511 ctest --test-dir build -j8 --test-load 32 -R '^(agc_driver_graphics|agc_driver_gcn_detile)$' --output-on-failure # negative control: Graphics/src/TextureTiling.cpp restored from cc596afba5 (the head just before the fix, with main already merged) ninja -C build -j32 -l32 agc_driver_graphics_tests ctest --test-dir build -R '^agc_driver_graphics$' --output-on-failure # restored from the merged tree, rebuilt, re-ran: passed # validation-ID attribution for agc_driver_image_gather_volume, on the merged tree and with all 8 PR files restored from main VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R '^agc_driver_image_gather_volume$' git status --porcelain # empty at the end ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | 0 errors, 1 warning: `[debt-length]` on `docs/dev/debt/libSceAgcDriver.md:118` (1212 characters) | | Build of the merged tree (script) | OK | | `agc_driver_graphics` | Passed (34.9 s with `-j8`, 34.2 s alone) | | `agc_driver_gcn_detile` | Passed (3.6 s) | | Tests the change can reach (script, 2182 run) | 0 new failures, 0 timeouts; 7 known failures that also fail on `main` | | Validation layer (script, 783 tests on lavapipe) | layer loaded in 782 of 782 that create an instance; the only new IDs are in `agc_driver_image_gather_volume` and come from `main` (see below) | **The new validation IDs come from `main`.** build.json lists 4 `VkSamplerCreateInfo` IDs in `agc_driver_image_gather_volume`, a test the baseline did not run. The test uses no GCN tile mode. I ran it with the layer in two states: | Tree | VUID lines | |---|---| | Merged tree | 8 | | All 8 PR files restored from `main` | 8, the same IDs | <details><summary>VUIDs, identical in both runs</summary> ``` 2 VUID-VkSamplerCreateInfo-addressModeU-01079 2 VUID-VkSamplerCreateInfo-addressModeU-parameter 2 VUID-VkSamplerCreateInfo-addressModeV-parameter 2 VUID-VkSamplerCreateInfo-addressModeW-parameter ``` </details> ## Negative control I reverted only the layout part of the fix: `Graphics/src/TextureTiling.cpp` as it was at cc596afba5, keeping the new header, detiler and tests. `agc_driver_graphics` then fails with: ``` AGC graphics: PS4 full volume mip chain differs from addrlib ``` With the merged file restored it passes again. This confirms the author's harness result from the Refresh note. The test also checks `GuestOffset(1, mips[4]) == 150784` and the `MipTileMode` selection, so it covers the header changes too. I recomputed the pinned numbers by hand for a 32-bit 32³ chain: | Level | Size | Layout | Bytes | Ends at | |---|---|---|---|---| | 0 | 32³ | thick | 131072 | 131072 | | 1 | 16³ | thick | 16384 | 147456 | | 2 | 8³ | thick | 2048 | 149504 | | 3 | 4³ | one thick 8x8x4 slab | 1024 | 150528 | | 4 | 2³ | two thin 256-byte slices | 512 | 151040 | | 5 | 1³ | one thin 256-byte slice | 256 | 151296 | 151296 is the total I gave in my last review. The 8- and 16-bit cases need pitches of 32 and 16 elements to reach a 256-byte slice, both 32 bytes. That matches the test. ## Previous findings - **Blocking 1, shallow mip levels laid out thick: Resolved.** Levels with `level > 0 && levelDepth < 4` are 1D thin with single-slice strides and the SI pitch adjustment. The uploads and write-backs that go through `Dispatch` choose the thin pipeline for them. `DispatchImage` always asks for a non-thick pipeline, so it is unaffected. The new six-level test pins the layout, and it fails without the fix. - **Non-blocking 1, "checked against addrlib" wording: Resolved.** The description and the debt entry now say how levels under four slices are handled and name `ComputeSurfaceInfoMicroTiled` and `HwlGetSizeAdjustmentMicroTiled`. - **Non-blocking 2, no GPU detile case for mode 19: Still open, non-blocking.** `GcnDetile.cpp` still has no tile-mode-19 case, and the debt entry says so ("mode 19 has layout tests only"). Nothing on a device has run the thick shader path or the new thin-level pipeline choice. ## New findings ### Blocking None. ### Non-blocking 1. **The debt entry is over the length limit again.** `check_conventions.py` warns that [the entry](https://github.com/boykopovar/AnyPS5/blob/9fde6efab2b0af27a335af369a1b36b128169420/docs/dev/debt/libSceAgcDriver.md#L118) has 1212 characters; the limit is 1000. 297118f83b had brought it under the limit, and 9fde6efab2 adds the degrade sentence. CONTRIBUTING asks entries to state the gap first. Suggested fix: cut the description of implemented behaviour, for example the 8x8x4 order and the degrade mechanics, down to the source names. Keep what is unchecked and what throws. 2. **The required validation and GPU evidence is from older heads.** The Refresh note says `agc_driver_graphics`, the GPU detiler and the paired validation run were not rerun on this head. The `GPUs tested` line still refers to the earlier RTX 2080 runs. On lavapipe I found nothing new from this PR, but CONTRIBUTING asks the author to run the paired check for AGC driver changes. Please rerun it on the RTX 2080 and update the Tested section. 3. **`agc_driver_graphics` runs over 30 s here (34.2 s alone).** The PR adds only small CPU cases, and TechLevelZero's NVIDIA runs already showed this test at about 30 s, so I don't count this against the PR. I did not measure `main` alone on this machine. ## Not verified - No GPU run of the mode-19 thick or degraded-thin detile shader; no fixture exercises it. - Paired validation on a hardware GPU. Only lavapipe was run here. - Console behaviour, and whether Sony's GpuAddress library applies the same degrade as addrlib. - I checked addrlib's behaviour from my previous review's reading of the source. I did not re-read the addrlib source in this pass (no network). - Gang Beasts (CUSA04865). I launch no titles. - Windows. <!-- anyps5-bots job=3609 head=9fde6efab2b0af27a335af369a1b36b128169420 -->
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!9674
No description provided.