fix(agc): decode PS4 texture bases, linear-aligned targets and thin-tiled 3D textures #9891

Merged
savvaniss merged 21 commits from upstream-pr/9891 into main 2026-11-03 22:25:48 +00:00
savvaniss commented 2026-10-22 20:49:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-22T20:49:23Z.


What

The AGC half of Get-fix/AnyPS5#1, moved upstream as Get-fix asked. #9431, which this was stacked on, is merged, and this branch has main merged in. These are four PS4 surface fixes found while bringing up Risk and Monopoly Plus from CUSA03312 on #6977's branch. The shader half is in its own pull request on main, #9889.

  1. Display buffers presented before they are drawn. PresentDisplayBuffer uploaded a tiled display buffer with no resident image through GpuColorTransfer, in the PS5 render-target layout. That layout needs 64 KiB alignment and doesn't know GCN tiling. Risk flips its 32 KiB-aligned 1920x1080 buffers before drawing into them, and failed with "null or misaligned address". A GCN-tiled buffer with no resident image now goes through ReadDisplayBuffer, which decodes the GCN layout and checks the buffer's own 4 KiB alignment.
    • The decoded pixels then take the same path as a linear buffer's, so the HDR10 scaler, frame dumps, screenshots and the overlay plane all apply.
    • DecodeDisplayBuffer's 4-byte loop only knew the linear and PS5 layouts. It now uses texelOffset, the same change as #9673, carried here because this path reaches it.
    • VideoOut on main can't register a tiled PS4 buffer yet (#9432 does that), so titles reach this path once #9432 lands.
  2. T# base address. In a GCN T#, word 1 bits 6-7 are MTYPE_L2, so the base is 38 bits (shadPS4's resource.h: base_address : 38; mtype_l2 : 2). DecodeTextureResource read 40 bits. So MTYPE_L2 = 1 set address bit 46, and a storage texture failed with "storage texture has no committed guest pages". IsNullTextureResource reads the base the same way now, so a zero base with MTYPE_L2 set is null.
  3. Linear-aligned color targets. Tile mode index 8 used the PS5 linear layout, which pads the pitch to 256 bytes. GCN pads a linear-aligned pitch to max(8, 64 / bytes per element) elements, as AddrLib's SiLib::HwlGetPitchAlignmentLinear does and as #9431's PS4 texture layout already does. ColorTileMode::GcnLinear carries that alignment.
    • main has resident linear targets since this was written. They keep taking only PS5 Linear targets, so a GCN linear-aligned target is still copied in and out as before. Making it resident is separate work.
    • main now draws a DB depth copy through the normal draw path, and RunDepthCopyPass is gone. So the linear check this PR changed there went with it. A depth copy into a GCN linear-aligned target is drawn like any other draw into a linear target that is not resident.
  4. PS4 3D textures in thin tile modes. A thin-tiled volume is laid out like a layered surface whose level n holds max(1, depth >> n) slices, padded to a power of two with POW2_PAD. That is how ac_surface and AddrLib's PostComputeMipLevel count them. It becomes one 3D image of its depth, and thick modes still throw. The debt entry for thick and layered surfaces says so.

Tested

Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release, AMD Radeon RX 9070 XT (driver 32.0.31041.1004), ANYPS5_GPU=AMD, ctest -V with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation.

Merge of main de83e8f270, 31 Oct. Head 341659473d. The only conflict was in docs/dev/debt/libSceAgcDriver.md: both sides kept, with main's layer bank text as its own debt entry to stay under the length limit. On the merge before that debt split: agc_driver_graphics, agc_driver_gcn_detile and agc_driver_gcn_display_present pass, 3 of 3 on the RX 9070 XT, no VUID- line. Not rerun: the other tests, Linux (main changed no struct under the size guards in this merge), games.

Merge of main cc26ab4438, 1 Nov. Head 825f9b3f7c. Two conflicts. main moved the AGC test registrations into tests/cmake, and tools/agc_test_split.py resolve moved this branch's decoder_png link to agc_driver_gcn_display_present_tests.cmake. In docs/dev/debt/libSceAgcDriver.md the merge keeps main's tiling and 2D PRT entries and this branch's thick and array layer bank entries. agc_driver_graphics, agc_driver_gcn_detile and agc_driver_gcn_display_present pass, 3 of 3 on the RX 9070 XT under the validation layer, no VUID- line. Not rerun: the other tests, Linux, games.

Merge of main 1e658521a0, 3 Nov. Head 9b9288abc8 (on ca0255b639). The only conflict was in docs/dev/debt/libSceAgcDriver.md: the merge keeps this branch's thick and layered, array layer bank and resident-image flip entries, and main's render-target entry with its new PS4 depth-target sentence. FormatVersion stays main's 52 (this branch does not change it) and no size guard changes. On the RX 9070 XT (driver 32.0.31041.1004, Windows, Release) with ANYPS5_GPU=AMD ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation: agc_driver, agc_driver_graphics, agc_driver_flip, agc_shader_memory, agc_driver_gcn_detile and agc_driver_gcn_display_present pass, 6 of 6, every Selected GPU line names the RX 9070 XT and there is no VUID- line. tools/check_conventions.py --base origin/main passes. Not rerun: the rest of the suite, Linux, and the game.

Base. #9431 is merged, so this branch is main plus this PR's own changes. Tests ran on main 5b913d40c6 and on this branch with that main merged in. The final merge of main fd41cca5d9 touches no AGC, VideoOut or shader file.

Results.

tree passed skipped VUID- lines
main 5b913d40c6 65 of 65 video_out_hdr_probe (the monitor reports HDR) 0
this branch 66 of 66 the same 0
  • The one extra test is the new agc_driver_gcn_display_present.
  • The set:
    • agc_driver, agc_driver_pm4, agc_driver_graphics, agc_driver_register_key, agc_driver_gcn_detile, agc_driver_gcn_buffer_format_lookup and agc_driver_pattern_buffer_fill;
    • agc_driver_flip, the video_out_flip_* modes, video_out_hdr_present, video_out_hdr_probe, linear_display_buffer, agc_display_buffer_dcc, agc_host_hdr and agc_screenshot;
    • agc_gcn_decode, texture_format_lookup, agc_driver_resource_cache_replaced_texture and agc_depth_copy_kept_bytes;
    • the agc_driver_pipeline_journal and agc_pipeline_journal* tests, and the agc_driver_depth_* tests.
  • Neither log has was not found but was requested by env var VK_INSTANCE_LAYERS, and every Selected GPU line names the RX 9070 XT.
  • The video_out_flip_* tests ran on a real window here. None of them skipped.

Revert checks. One part at a time on this branch, each rebuilt and run with the same environment. The first group is agc_driver_gcn_display_present; the rest are agc_driver_graphics or agc_driver_gcn_detile.

part removed failure
1, the early return as it was on the HDR10 swapchain: "an HDR10 presentation through the scaler needs the HDR10 scaler and dumps on the CPU"
1, the early return as it was, APS5_FORCE_SDR=1 "SDR presentation of the 8-bit buffer: the screenshot was not written"
1, no ensureHdrScaler for a GCN flip the same HDR10 message
1, no frame dump for a GCN flip "SDR presentation of the 8-bit buffer: no frame dump within one level of the expected pixels (closest differs by 256, 0 dumps)"
1, no CPU decode for a GCN flip "AGC driver: null or misaligned address"
1, DisplayBuffer.cpp as on main "SDR presentation of the 8-bit buffer: no frame dump within one level of the expected pixels (closest differs by 255, 3 dumps)"
2, the 40-bit mask in the decode "a PS4 T# took MTYPE_L2 above its 38-bit base as address bits"
2, the 40-bit mask in IsNullTextureResource "a PS4 T# with a zero base and MTYPE_L2 set was not classified as null"
3, ColorTargetLayout.cpp as on main "unsupported color tile mode"
4, a PS4 volume refused again "PS4 3D and multisampled textures are not implemented", in both tests
4, a PS4 volume as a depth-1 image "PS4 volume in tile mode 15: the surface is not one 3D image of its depth, stored level by level"

agc_driver_gcn_display_present (new).

  • It presents a 32 KiB-aligned GCN buffer on a real window through the driver's present entry point. VideoOut on main can't register a tiled PS4 buffer yet (#9432 does that), so video_out_flip_ps4 can't reach this path.
  • It checks the frame dump and the screenshot pixel by pixel, against values computed from the fill pattern and not from the decode.
  • It runs an 8-bit buffer and a PQ buffer on SDR, and a PQ buffer on a real HDR10 swapchain (format 64, color space 1000104008). The test sets the display's HDR state itself, and needs a surface that offers HDR10. It prints that HDR10 was not exercised if the surface doesn't, and skips without a display or Vulkan.

agc_driver_gcn_detile (new case).

  • A 6-slice volume with three levels, in Thin1D, Display1D, Display2D and Thin2D, with and without POW2_PAD.
  • It runs the GPU detiler over each level's 6, 3 and 1 slices and compares every element.
  • Before that, it checks where each level starts: level 1 after the 6 level 0 slices, level 2 after 3 level 1 slices (4 with POW2_PAD), and the end of the surface after the one level 2 slice. The element comparison alone can't catch a wrong slice count, because the fixture places slices with the same geometry.
  • It then creates the 3D Texture, so the validation layer sees the image and its per-level copies. The test doesn't read that image back (it has no transfer-source usage) and doesn't sample it.

Linux. WSL Ubuntu, g++ 15.2.0, cmake 4.2.3, Unix Makefiles, Release, -j 4, on the Linux filesystem, at this branch before the last main merge and a debt-only edit. The size guards are active there, so sizeof(State) == 920 and sizeof(ShaderStages) == 164 were evaluated. Built without errors: all of libSceAgcDriver, including Graphics/src/PipelineJournal.cpp and core/shader/recompiler/ShaderDiskCache.cpp, and agc_driver_graphics_tests, agc_driver_gcn_detile_tests and agc_driver_gcn_display_present_tests.

  • The tree has no X11 or audio development packages and I did not install any, so SDL's XRandR and audio configure checks were downgraded to messages in the throwaway copy's CMakeLists.txt. No source file changed.
  • agc_driver_graphics and agc_driver_gcn_detile passed there on Mesa's llvmpipe (software Vulkan, no validation layer). agc_driver_gcn_display_present skipped: SDL has no Vulkan video driver in that build.
  • No other Linux test ran.

CUSA03312. Each fix removed a stop in Risk or Monopoly Plus on ps4/limbo-gpu at 93eeee0141 (#6977's head then), with Get-fix/AnyPS5#2 and local stand-ins for sceGnmDrawInitDefaultHardwareState200 and sceGnmUpdate*Shader (Get-fix/AnyPS5#1 has the details). Not rerun on this base: the titles also need #9432.

Other people's runs. On head 375f5630ba, @ycbuzi ran the tests on an RTX 4070 SUPER, a GTX 1650 SUPER and an AMD RDNA2 iGPU, and @DealPotato ran them on an RTX 4070 with the flip tests on a real display. @DealPotato also took inFAMOUS Second Son (CUSA00004) past its "storage texture has no committed guest pages" stop through the T# base change.

Conventions. tools/check_conventions.py --base origin/main passes.

Overlap. tools/pr_overlap.py --branch fix/ps4-cusa03312-surfaces, against main fd41cca5d9, lists three pull requests:

  • #9674 (thick tile mode 19) lays out 3D textures in thick modes, and this PR lays them out in thin modes. They touch the same lines of TextureTiling.cpp and the thick-surface debt entry, and compose: a 3D T# in a thick mode takes #9674's path, and one in a thin mode takes this one.
  • #9672 and #9892 change neighbouring debt entries.

It could not compare 109 others that conflict with main themselves.

#9673 is not listed. Its DisplayBuffer.cpp hunk is byte-identical to the one here, and a simulated merge in either order shows no conflict in that file. Both histories carry #9431's old head, so the simulated merge does report one line of State.cpp: case 8u, which takes this PR's GcnLinear.

Allocation lookup, 2 Nov. Head ca0255b639, on a100474e12. main's TextureResourceAllocationAddress read 40 bits of the T# base, so a PS4 T# with MTYPE_L2 (word 1 bits 6-7) set looked up the allocation of an address above bit 46; descriptorBaseAddress now applies the same 38-bit mask as descriptorBase under GCN guest shaders. agc_driver_graphics checks that the lookup address of the MTYPE_L2 T# equals its decoded base, and fails with the fix removed ("a PS4 T# with MTYPE_L2 set looked up its allocation at an address other than its 38-bit base"). Run on Windows 11 Pro 26300 with ANYPS5_GPU=AMD, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation: agc_driver_graphics and agc_shader_memory pass, no VUID- line (neither opens a Vulkan device). Not rerun: the display-present tests, Linux, CUSA03312. check_conventions.py passes.

Level offsets, 3 Nov. Head cebb30f132, on 9b9288abc8. As @RNK123 suggested, the volume case now checks the level offsets above. On the RX 9070 XT (AMD driver 26.8.1, Windows, Release) with ANYPS5_GPU=AMD ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, agc_driver_gcn_detile passes 3 of 3, with no VUID- line. Each of four TextureTiling.cpp mutations fails it 3 of 3 at its own check, and the fixture without this commit passes all four: six slices kept at levels 1 and 2, no POW2_PAD rounding, level 0 rounded too, and guestBytes counting six last-level slices. check_conventions.py passes. Not rerun: the other tests, Linux, CUSA03312.

Checklist

  • Based on current main; no other open PR implements the same functions (main merged in; the one-line decode fix is shared with #9673, as asked on this pull request)
  • 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
  • Fixes: none
  • Unblocks: CUSA03312 #7198
  • GPUs tested: AMD Radeon RX 9070 XT, driver 32.0.31041.1004, Windows 11 Pro 26300
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4973926471 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9891). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-22T20:49:23Z. --- ### What The AGC half of Get-fix/AnyPS5#1, moved upstream as Get-fix asked. #9431, which this was stacked on, is merged, and this branch has `main` merged in. These are four PS4 surface fixes found while bringing up Risk and Monopoly Plus from CUSA03312 on #6977's branch. The shader half is in its own pull request on `main`, #9889. 1. **Display buffers presented before they are drawn.** `PresentDisplayBuffer` uploaded a tiled display buffer with no resident image through `GpuColorTransfer`, in the PS5 render-target layout. That layout needs 64 KiB alignment and doesn't know GCN tiling. Risk flips its 32 KiB-aligned 1920x1080 buffers before drawing into them, and failed with "null or misaligned address". A GCN-tiled buffer with no resident image now goes through `ReadDisplayBuffer`, which decodes the GCN layout and checks the buffer's own 4 KiB alignment. - The decoded pixels then take the same path as a linear buffer's, so the HDR10 scaler, frame dumps, screenshots and the overlay plane all apply. - `DecodeDisplayBuffer`'s 4-byte loop only knew the linear and PS5 layouts. It now uses `texelOffset`, the same change as #9673, carried here because this path reaches it. - VideoOut on `main` can't register a tiled PS4 buffer yet (#9432 does that), so titles reach this path once #9432 lands. 2. **T# base address.** In a GCN T#, word 1 bits 6-7 are `MTYPE_L2`, so the base is 38 bits (shadPS4's [`resource.h`](https://github.com/shadps4-emu/shadPS4/blob/main/src/video_core/amdgpu/resource.h): `base_address : 38; mtype_l2 : 2`). `DecodeTextureResource` read 40 bits. So `MTYPE_L2 = 1` set address bit 46, and a storage texture failed with "storage texture has no committed guest pages". `IsNullTextureResource` reads the base the same way now, so a zero base with `MTYPE_L2` set is null. 3. **Linear-aligned color targets.** Tile mode index 8 used the PS5 linear layout, which pads the pitch to 256 bytes. GCN pads a linear-aligned pitch to `max(8, 64 / bytes per element)` elements, as AddrLib's `SiLib::HwlGetPitchAlignmentLinear` does and as #9431's PS4 texture layout already does. `ColorTileMode::GcnLinear` carries that alignment. - `main` has resident linear targets since this was written. They keep taking only PS5 `Linear` targets, so a GCN linear-aligned target is still copied in and out as before. Making it resident is separate work. - `main` now draws a DB depth copy through the normal draw path, and `RunDepthCopyPass` is gone. So the linear check this PR changed there went with it. A depth copy into a GCN linear-aligned target is drawn like any other draw into a linear target that is not resident. 4. **PS4 3D textures in thin tile modes.** A thin-tiled volume is laid out like a layered surface whose level n holds max(1, depth >> n) slices, padded to a power of two with `POW2_PAD`. That is how [ac_surface](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-24.0.0/src/amd/common/ac_surface.c#L776) and AddrLib's [PostComputeMipLevel](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-24.0.0/src/amd/addrlib/src/core/addrlib1.cpp#L3818-L3842) count them. It becomes one 3D image of its depth, and thick modes still throw. The debt entry for thick and layered surfaces says so. ### Tested Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release, AMD Radeon RX 9070 XT (driver 32.0.31041.1004), `ANYPS5_GPU=AMD`, `ctest -V` with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`. **Merge of `main` `de83e8f270`, 31 Oct.** Head `341659473d`. The only conflict was in `docs/dev/debt/libSceAgcDriver.md`: both sides kept, with main's layer bank text as its own debt entry to stay under the length limit. On the merge before that debt split: `agc_driver_graphics`, `agc_driver_gcn_detile` and `agc_driver_gcn_display_present` pass, 3 of 3 on the RX 9070 XT, no `VUID-` line. Not rerun: the other tests, Linux (`main` changed no struct under the size guards in this merge), games. **Merge of `main` `cc26ab4438`, 1 Nov.** Head `825f9b3f7c`. Two conflicts. `main` moved the AGC test registrations into `tests/cmake`, and `tools/agc_test_split.py resolve` moved this branch's `decoder_png` link to `agc_driver_gcn_display_present_tests.cmake`. In `docs/dev/debt/libSceAgcDriver.md` the merge keeps `main`'s tiling and 2D PRT entries and this branch's thick and array layer bank entries. `agc_driver_graphics`, `agc_driver_gcn_detile` and `agc_driver_gcn_display_present` pass, 3 of 3 on the RX 9070 XT under the validation layer, no `VUID-` line. Not rerun: the other tests, Linux, games. **Merge of `main` `1e658521a0`, 3 Nov.** Head `9b9288abc8` (on `ca0255b639`). The only conflict was in `docs/dev/debt/libSceAgcDriver.md`: the merge keeps this branch's thick and layered, array layer bank and resident-image flip entries, and `main`'s render-target entry with its new PS4 depth-target sentence. `FormatVersion` stays `main`'s 52 (this branch does not change it) and no size guard changes. On the RX 9070 XT (driver 32.0.31041.1004, Windows, Release) with `ANYPS5_GPU=AMD ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`: `agc_driver`, `agc_driver_graphics`, `agc_driver_flip`, `agc_shader_memory`, `agc_driver_gcn_detile` and `agc_driver_gcn_display_present` pass, 6 of 6, every `Selected GPU` line names the RX 9070 XT and there is no `VUID-` line. `tools/check_conventions.py --base origin/main` passes. Not rerun: the rest of the suite, Linux, and the game. **Base.** #9431 is merged, so this branch is `main` plus this PR's own changes. Tests ran on `main` `5b913d40c6` and on this branch with that `main` merged in. The final merge of `main` `fd41cca5d9` touches no AGC, VideoOut or shader file. **Results.** | tree | passed | skipped | `VUID-` lines | |---|---|---|---| | `main` `5b913d40c6` | 65 of 65 | `video_out_hdr_probe` (the monitor reports HDR) | 0 | | this branch | 66 of 66 | the same | 0 | - The one extra test is the new `agc_driver_gcn_display_present`. - The set: - `agc_driver`, `agc_driver_pm4`, `agc_driver_graphics`, `agc_driver_register_key`, `agc_driver_gcn_detile`, `agc_driver_gcn_buffer_format_lookup` and `agc_driver_pattern_buffer_fill`; - `agc_driver_flip`, the `video_out_flip_*` modes, `video_out_hdr_present`, `video_out_hdr_probe`, `linear_display_buffer`, `agc_display_buffer_dcc`, `agc_host_hdr` and `agc_screenshot`; - `agc_gcn_decode`, `texture_format_lookup`, `agc_driver_resource_cache_replaced_texture` and `agc_depth_copy_kept_bytes`; - the `agc_driver_pipeline_journal` and `agc_pipeline_journal*` tests, and the `agc_driver_depth_*` tests. - Neither log has `was not found but was requested by env var VK_INSTANCE_LAYERS`, and every `Selected GPU` line names the RX 9070 XT. - The `video_out_flip_*` tests ran on a real window here. None of them skipped. **Revert checks.** One part at a time on this branch, each rebuilt and run with the same environment. The first group is `agc_driver_gcn_display_present`; the rest are `agc_driver_graphics` or `agc_driver_gcn_detile`. | part removed | failure | |---|---| | 1, the early return as it was | on the HDR10 swapchain: "an HDR10 presentation through the scaler needs the HDR10 scaler and dumps on the CPU" | | 1, the early return as it was, `APS5_FORCE_SDR=1` | "SDR presentation of the 8-bit buffer: the screenshot was not written" | | 1, no `ensureHdrScaler` for a GCN flip | the same HDR10 message | | 1, no frame dump for a GCN flip | "SDR presentation of the 8-bit buffer: no frame dump within one level of the expected pixels (closest differs by 256, 0 dumps)" | | 1, no CPU decode for a GCN flip | "AGC driver: null or misaligned address" | | 1, `DisplayBuffer.cpp` as on `main` | "SDR presentation of the 8-bit buffer: no frame dump within one level of the expected pixels (closest differs by 255, 3 dumps)" | | 2, the 40-bit mask in the decode | "a PS4 T# took MTYPE_L2 above its 38-bit base as address bits" | | 2, the 40-bit mask in `IsNullTextureResource` | "a PS4 T# with a zero base and MTYPE_L2 set was not classified as null" | | 3, `ColorTargetLayout.cpp` as on `main` | "unsupported color tile mode" | | 4, a PS4 volume refused again | "PS4 3D and multisampled textures are not implemented", in both tests | | 4, a PS4 volume as a depth-1 image | "PS4 volume in tile mode 15: the surface is not one 3D image of its depth, stored level by level" | **`agc_driver_gcn_display_present` (new).** - It presents a 32 KiB-aligned GCN buffer on a real window through the driver's present entry point. VideoOut on `main` can't register a tiled PS4 buffer yet (#9432 does that), so `video_out_flip_ps4` can't reach this path. - It checks the frame dump and the screenshot pixel by pixel, against values computed from the fill pattern and not from the decode. - It runs an 8-bit buffer and a PQ buffer on SDR, and a PQ buffer on a real HDR10 swapchain (format 64, color space 1000104008). The test sets the display's HDR state itself, and needs a surface that offers HDR10. It prints that HDR10 was not exercised if the surface doesn't, and skips without a display or Vulkan. **`agc_driver_gcn_detile` (new case).** - A 6-slice volume with three levels, in Thin1D, Display1D, Display2D and Thin2D, with and without `POW2_PAD`. - It runs the GPU detiler over each level's 6, 3 and 1 slices and compares every element. - Before that, it checks where each level starts: level 1 after the 6 level 0 slices, level 2 after 3 level 1 slices (4 with `POW2_PAD`), and the end of the surface after the one level 2 slice. The element comparison alone can't catch a wrong slice count, because the fixture places slices with the same geometry. - It then creates the 3D `Texture`, so the validation layer sees the image and its per-level copies. The test doesn't read that image back (it has no transfer-source usage) and doesn't sample it. **Linux.** WSL Ubuntu, g++ 15.2.0, cmake 4.2.3, Unix Makefiles, Release, `-j 4`, on the Linux filesystem, at this branch before the last `main` merge and a debt-only edit. The size guards are active there, so `sizeof(State) == 920` and `sizeof(ShaderStages) == 164` were evaluated. Built without errors: all of `libSceAgcDriver`, including `Graphics/src/PipelineJournal.cpp` and `core/shader/recompiler/ShaderDiskCache.cpp`, and `agc_driver_graphics_tests`, `agc_driver_gcn_detile_tests` and `agc_driver_gcn_display_present_tests`. - The tree has no X11 or audio development packages and I did not install any, so SDL's XRandR and audio configure checks were downgraded to messages in the throwaway copy's `CMakeLists.txt`. No source file changed. - `agc_driver_graphics` and `agc_driver_gcn_detile` passed there on Mesa's llvmpipe (software Vulkan, no validation layer). `agc_driver_gcn_display_present` skipped: SDL has no Vulkan video driver in that build. - No other Linux test ran. **CUSA03312.** Each fix removed a stop in Risk or Monopoly Plus on `ps4/limbo-gpu` at `93eeee0141` (#6977's head then), with Get-fix/AnyPS5#2 and local stand-ins for `sceGnmDrawInitDefaultHardwareState200` and `sceGnmUpdate*Shader` (Get-fix/AnyPS5#1 has the details). Not rerun on this base: the titles also need #9432. **Other people's runs.** On head `375f5630ba`, @ycbuzi ran the tests on an RTX 4070 SUPER, a GTX 1650 SUPER and an AMD RDNA2 iGPU, and @DealPotato ran them on an RTX 4070 with the flip tests on a real display. @DealPotato also took inFAMOUS Second Son (CUSA00004) past its "storage texture has no committed guest pages" stop through the T# base change. **Conventions.** `tools/check_conventions.py --base origin/main` passes. **Overlap.** `tools/pr_overlap.py --branch fix/ps4-cusa03312-surfaces`, against `main` `fd41cca5d9`, lists three pull requests: - #9674 (thick tile mode 19) lays out 3D textures in thick modes, and this PR lays them out in thin modes. They touch the same lines of `TextureTiling.cpp` and the thick-surface debt entry, and compose: a 3D T# in a thick mode takes #9674's path, and one in a thin mode takes this one. - #9672 and #9892 change neighbouring debt entries. It could not compare 109 others that conflict with `main` themselves. #9673 is not listed. Its `DisplayBuffer.cpp` hunk is byte-identical to the one here, and a simulated merge in either order shows no conflict in that file. Both histories carry #9431's old head, so the simulated merge does report one line of `State.cpp`: `case 8u`, which takes this PR's `GcnLinear`. **Allocation lookup, 2 Nov.** Head `ca0255b639`, on `a100474e12`. `main`'s `TextureResourceAllocationAddress` read 40 bits of the T# base, so a PS4 T# with MTYPE_L2 (word 1 bits 6-7) set looked up the allocation of an address above bit 46; `descriptorBaseAddress` now applies the same 38-bit mask as `descriptorBase` under GCN guest shaders. `agc_driver_graphics` checks that the lookup address of the MTYPE_L2 T# equals its decoded base, and fails with the fix removed ("a PS4 T# with MTYPE_L2 set looked up its allocation at an address other than its 38-bit base"). Run on Windows 11 Pro 26300 with `ANYPS5_GPU=AMD`, `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`: `agc_driver_graphics` and `agc_shader_memory` pass, no `VUID-` line (neither opens a Vulkan device). Not rerun: the display-present tests, Linux, CUSA03312. `check_conventions.py` passes. **Level offsets, 3 Nov.** Head `cebb30f132`, on `9b9288abc8`. As @RNK123 suggested, the volume case now checks the level offsets above. On the RX 9070 XT (AMD driver 26.8.1, Windows, Release) with `ANYPS5_GPU=AMD ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `agc_driver_gcn_detile` passes 3 of 3, with no `VUID-` line. Each of four `TextureTiling.cpp` mutations fails it 3 of 3 at its own check, and the fixture without this commit passes all four: six slices kept at levels 1 and 2, no `POW2_PAD` rounding, level 0 rounded too, and `guestBytes` counting six last-level slices. `check_conventions.py` passes. Not rerun: the other tests, Linux, CUSA03312. ### 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 (`main` merged in; the one-line decode fix is shared with #9673, as asked on this pull request) - [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 - [x] Fixes: none - [x] Unblocks: CUSA03312 #7198 - [x] GPUs tested: AMD Radeon RX 9070 XT, driver 32.0.31041.1004, Windows 11 Pro 26300 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
XairRrR commented 2026-10-29 03:59:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T03:59:51Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The four surface fixes are each pinned by a test that fails when the fix is reverted, but the branch conflicts with current main, does not compile on Linux, and the new display-buffer early return breaks HDR10 presentation and skips frame dumps and screenshots.

What I ran

  • PR head: 375f5630ba0e7639d2b1fda7cebc609eb7767daf
  • main: b433c40f2f46aa2e59e19806010a839ac8572d64
  • Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Ninja, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), in a clean worktree.
git fetch origin main pull/9891/head:refs/review/9891
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/9891        # conflicts, aborted; the rest runs on the PR head
git checkout --detach refs/review/9891
git diff --check origin/main...refs/review/9891
python3 tools/check_conventions.py --base origin/main
cmake -S . -B build
cmake --build build -j10 --target agc_driver_graphics_tests agc_driver_flip_tests agc_driver_gcn_detile_tests video_out_flip_tests agc_gcn_decode_tests
# the build fails in PipelineJournal.cpp (see below); to run the tests anyway, the two
# expected sizes were changed locally to 848 and 116 (not part of the PR), then:
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 -j4 -V --output-on-failure -R '^(agc_driver_graphics|agc_driver_gcn_detile|agc_driver_flip|agc_gcn_decode|video_out_flip_.*)$'
# negative control, one part at a time, files taken from 375f5630ba^2 (merge/9431-main):
git checkout 375f5630ba^2 -- <production file(s)>   # then restored from 375f5630ba
cmake --build build -j10 --target agc_driver_graphics_tests
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R '^agc_driver_graphics$' --output-on-failure
# baseline: the same build targets (without agc_driver_gcn_detile_tests) and the same ctest command on origin/main

Results

Check Result
Merge into main b433c40f2f Conflicts in Graphics/include/State.hpp, Graphics/src/Draw.cpp, Graphics/src/State.cpp
git diff --check clean
tools/check_conventions.py --base origin/main All conventions checks passed.
Build of the PR head on Linux/GCC fails: two static_asserts in PipelineJournal.cpp
Focused tests on the PR head (asserts patched locally) 20 of 20 pass, 15 of them video_out_flip_* skips (SDL offscreen, no Vulkan surface)
VUID- lines on the PR head 0
was not found but was requested by env var VK_INSTANCE_LAYERS absent; loader log shows VK_LAYER_KHRONOS_validation added
Negative control all three revert checks fail with the messages the description gives
Build failure on the PR head itself (no merge)
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:41:29: error: static assertion failed: State changed: update CanonicalPipelineState and the recipe codec
   41 | static_assert(sizeof(State) == 840, "State changed: update CanonicalPipelineState and the recipe codec");
  • the comparison reduces to '(848 == 840)'
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:42:36: error: static assertion failed: ShaderStages changed: update the recipe codec
   42 | static_assert(sizeof(ShaderStages) == 112, "ShaderStages changed: update the recipe codec");
  • the comparison reduces to '(116 == 112)'

(GCC 16 prints these in the host locale; translated.)

Focused tests on the PR head, validation layer on
 1/20 Test #1447: agc_gcn_decode .......................   Passed    0.00 sec
 6/20 Test #1854: video_out_flip_decode ................   Passed    0.00 sec
10/20 Test #1858: video_out_flip_ps4 ...................***Skipped   0.03 sec
18/20 Test  #663: agc_driver_flip ......................   Passed    0.61 sec
19/20 Test  #833: agc_driver_gcn_detile ................   Passed    0.70 sec
20/20 Test  #665: agc_driver_graphics ..................   Passed    5.03 sec
100% tests passed out of 20
1850: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
833: [src/VulkanDevice.cpp:1270 VulkanDevice] Selected GPU name=NVIDIA GeForce RTX 4070 Ti SUPER vendor=0x10de device=0x2705 subgroup=32
Same focused set on main b433c40f2f, same machine, validation layer on
 1/20 Test #1784: agc_gcn_decode .......................   Passed    0.00 sec
 2/20 Test #2314: video_out_flip_decode ................   Passed    0.01 sec
16/20 Test  #946: agc_driver_flip ......................   Passed    0.61 sec
20/20 Test  #948: agc_driver_graphics ..................   Passed    4.61 sec
100% tests passed out of 20

VUID- lines: 0 on main and 0 on the PR head. Neither log has was not found but was requested by env var VK_INSTANCE_LAYERS. agc_driver_gcn_detile does not exist on main.

Negative control

I restored only the production files of one part at a time from 375f5630ba^2 (merge/9431-main), rebuilt agc_driver_graphics_tests and ran agc_driver_graphics:

Reverted Result
Graphics/src/GuestTextureResource.cpp (part 2) fails: a PS4 T# took the MIN_LOD bits above its 38-bit base as address bits
Graphics/src/TextureTiling.cpp and Graphics/include/TextureTiling.hpp (part 4) fails: PS4 3D and multisampled textures are not implemented
Graphics/src/ColorTargetLayout.cpp (part 3) fails: unsupported color tile mode

This matches the table in the description. Part 1 (PresentDisplayBuffer) has no test, so it has no negative control.

Findings

Blocking

  1. Conflicts with main. Merging into main b433c40f2f conflicts in core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp (ShaderStages gained hullWaveSize/tessellationGeometry on main against legacyVertex here, and DrawKeyRegisters is 50 entries on main against 52 here), Graphics/src/Draw.cpp (the linearResident line that #9879 changed, which the description expected) and Graphics/src/State.cpp (decodeDepthPlane extent, DecodeShaderStages routing, DecodeColorFormat). Most of these hunks come from #9431, which is still open. Fix: merge main again once #9431 is updated, or land #9431 first.

  2. The PR head does not compile on Linux x86-64 with libstdc++. PipelineJournal.cpp L41-L42 asserts sizeof(State) == 840 and sizeof(ShaderStages) == 112. On this branch they are 848 and 116, after #9431 added ShaderStages::legacyVertex. The asserts sit under #if defined(__linux__) && defined(__x86_64__) && defined(__GLIBCXX__), so the Windows runs in the description and comments could not hit them. This confirms the earlier comment that reported the same failure after a merge with main. It fails on the PR head too, without any merge. The fix is not to bump the numbers: the recipe codec and CanonicalPipelineState need to carry the new field. Otherwise a pipeline restored from the journal loses legacyVertex. Then update the expected sizes.

  3. A non-resident GCN flip on an HDR10 swapchain throws. The new early return at VulkanDevice.cpp L3432-L3435 calls present(..., pixels, nullptr, nullptr, ..., passthrough). That return comes before L3455, if (passthrough && resident == nullptr) ensureHdrScaler(...). With passthrough set, no resident image and pixels given, present has drawn == false and clearOnly == false, so L3539 requires state->hdrScaler != nullptr. useSurfaceFormat resets hdrScaler, so the first such flip after the swapchain picks an HDR10 format fails with "an HDR10 presentation through the scaler needs the HDR10 scaler and dumps on the CPU". If an earlier flip left a scaler for another source format, the texels go through that one instead. The same early return also skips the frame-dump block (L3438) and takeScreenshot (L3451), so frame dumps and screenshots silently miss these flips. Fix: don't return early. Compute pixels for this case and fall through to the common tail, passing pixels instead of &buffer. Then the ensureHdrScaler, dump and screenshot handling applies to it. A video_out_flip_ps4 case with a GCN buffer and no resident image (as requested in an earlier comment) would cover it.

  4. The display decode this path relies on is still wrong for GCN buffers. I confirm the point raised twice in the comments: DisplayBuffer.cpp L198-L199 still uses the linear or 64 KiB PS5 formula for DisplayTilingGcn (value 2). Part 1 now sends every non-resident GCN flip with a 32-bit format through it in SDR. #9673 is still open and the body still says only Depends on: #9431. Fix: carry the texelOffset change or add Depends on: #9673.

Non-blocking

  1. tests/GuestTextureResource.cpp L791: the failure message says "MIN_LOD bits", but the bits above the 38-bit base are MTYPE_L2 (word 1 bits 6-7, 0xc0 in the test word). MIN_LOD is bits 8-19 and a 40-bit mask never reached it. Suggest "took MTYPE_L2 above its 38-bit base as address bits".
  2. IsNullTextureResource, GuestTextureResource.cpp L123 still masks 40 bits. A PS4 T# with a zero base and a non-zero MTYPE_L2 is reported as not null, and DecodeTextureResource then throws "guest texture descriptor has a null base address". Applying the same gcn ? 0x3fffffffff : 0xffffffffff mask there keeps the two consistent.
  3. docs/dev/debt/libSceAgcDriver.md L71 still opens with "3D and thick modes (GB_TILE_MODE 15 and 19 to 26) throw", then says a 3D surface in a thin mode is laid out. "Thick modes (GB_TILE_MODE 15 and 19 to 26) throw" would no longer contradict the next sentence.
  4. Part 4 is covered by layout arithmetic in tests/TextureTiling.cpp only. tests/execution/GcnDetile.cpp has no 3D case, so no test runs the GPU detile and upload of a level-major PS4 volume with imageDepth > 1. A small 3D thin-mode case there would test the image creation and per-level slice counts end to end.

Not verified

  • The merged tree: the merge conflicts, so everything above ran on the PR head, which is based on main 07da04f947.
  • A build without the local change to the two static_assert values.
  • video_out_flip_* other than video_out_flip_decode: they skip here (SDL offscreen), so the PresentDisplayBuffer change was not exercised by any test I ran.
  • HDR10 presentation at runtime: finding 3 is from reading the code, not from a run.
  • No title was run.

To get this to a good state

  1. Bring the branch up to current main (after #9431 is updated or merged) and resolve the three conflicts.
  2. Update the pipeline-journal codec and CanonicalPipelineState for the new ShaderStages/State fields, then the expected sizes, and build on Linux.
  3. Route the non-resident GCN flip through the common tail of PresentDisplayBuffer so the HDR10 scaler, frame dumps and screenshots apply. Add a flip test for it.
  4. Carry #9673's decode fix or list it under Depends on.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5692679803 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9891#pullrequestreview-5692679803). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T03:59:51Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The four surface fixes are each pinned by a test that fails when the fix is reverted, but the branch conflicts with current `main`, does not compile on Linux, and the new display-buffer early return breaks HDR10 presentation and skips frame dumps and screenshots. ## What I ran - PR head: `375f5630ba0e7639d2b1fda7cebc609eb7767daf` - `main`: `b433c40f2f46aa2e59e19806010a839ac8572d64` - Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Ninja, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), in a clean worktree. ```sh git fetch origin main pull/9891/head:refs/review/9891 git checkout --detach origin/main git merge --no-ff --no-edit refs/review/9891 # conflicts, aborted; the rest runs on the PR head git checkout --detach refs/review/9891 git diff --check origin/main...refs/review/9891 python3 tools/check_conventions.py --base origin/main cmake -S . -B build cmake --build build -j10 --target agc_driver_graphics_tests agc_driver_flip_tests agc_driver_gcn_detile_tests video_out_flip_tests agc_gcn_decode_tests # the build fails in PipelineJournal.cpp (see below); to run the tests anyway, the two # expected sizes were changed locally to 848 and 116 (not part of the PR), then: 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 -j4 -V --output-on-failure -R '^(agc_driver_graphics|agc_driver_gcn_detile|agc_driver_flip|agc_gcn_decode|video_out_flip_.*)$' # negative control, one part at a time, files taken from 375f5630ba^2 (merge/9431-main): git checkout 375f5630ba^2 -- <production file(s)> # then restored from 375f5630ba cmake --build build -j10 --target agc_driver_graphics_tests ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R '^agc_driver_graphics$' --output-on-failure # baseline: the same build targets (without agc_driver_gcn_detile_tests) and the same ctest command on origin/main ``` ## Results | Check | Result | |---|---| | Merge into `main` `b433c40f2f` | **Conflicts** in `Graphics/include/State.hpp`, `Graphics/src/Draw.cpp`, `Graphics/src/State.cpp` | | `git diff --check` | clean | | `tools/check_conventions.py --base origin/main` | `All conventions checks passed.` | | Build of the PR head on Linux/GCC | **fails**: two `static_assert`s in `PipelineJournal.cpp` | | Focused tests on the PR head (asserts patched locally) | 20 of 20 pass, 15 of them `video_out_flip_*` skips (SDL `offscreen`, no Vulkan surface) | | `VUID-` lines on the PR head | 0 | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | absent; loader log shows `VK_LAYER_KHRONOS_validation` added | | Negative control | all three revert checks fail with the messages the description gives | <details><summary>Build failure on the PR head itself (no merge)</summary> ```text core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:41:29: error: static assertion failed: State changed: update CanonicalPipelineState and the recipe codec 41 | static_assert(sizeof(State) == 840, "State changed: update CanonicalPipelineState and the recipe codec"); • the comparison reduces to '(848 == 840)' core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:42:36: error: static assertion failed: ShaderStages changed: update the recipe codec 42 | static_assert(sizeof(ShaderStages) == 112, "ShaderStages changed: update the recipe codec"); • the comparison reduces to '(116 == 112)' ``` (GCC 16 prints these in the host locale; translated.) </details> <details><summary>Focused tests on the PR head, validation layer on</summary> ```text 1/20 Test #1447: agc_gcn_decode ....................... Passed 0.00 sec 6/20 Test #1854: video_out_flip_decode ................ Passed 0.00 sec 10/20 Test #1858: video_out_flip_ps4 ...................***Skipped 0.03 sec 18/20 Test #663: agc_driver_flip ...................... Passed 0.61 sec 19/20 Test #833: agc_driver_gcn_detile ................ Passed 0.70 sec 20/20 Test #665: agc_driver_graphics .................. Passed 5.03 sec 100% tests passed out of 20 1850: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform 833: [src/VulkanDevice.cpp:1270 VulkanDevice] Selected GPU name=NVIDIA GeForce RTX 4070 Ti SUPER vendor=0x10de device=0x2705 subgroup=32 ``` </details> <details><summary>Same focused set on <code>main</code> <code>b433c40f2f</code>, same machine, validation layer on</summary> ```text 1/20 Test #1784: agc_gcn_decode ....................... Passed 0.00 sec 2/20 Test #2314: video_out_flip_decode ................ Passed 0.01 sec 16/20 Test #946: agc_driver_flip ...................... Passed 0.61 sec 20/20 Test #948: agc_driver_graphics .................. Passed 4.61 sec 100% tests passed out of 20 ``` `VUID-` lines: 0 on `main` and 0 on the PR head. Neither log has `was not found but was requested by env var VK_INSTANCE_LAYERS`. `agc_driver_gcn_detile` does not exist on `main`. </details> ## Negative control I restored only the production files of one part at a time from `375f5630ba^2` (`merge/9431-main`), rebuilt `agc_driver_graphics_tests` and ran `agc_driver_graphics`: | Reverted | Result | |---|---| | `Graphics/src/GuestTextureResource.cpp` (part 2) | fails: `a PS4 T# took the MIN_LOD bits above its 38-bit base as address bits` | | `Graphics/src/TextureTiling.cpp` and `Graphics/include/TextureTiling.hpp` (part 4) | fails: `PS4 3D and multisampled textures are not implemented` | | `Graphics/src/ColorTargetLayout.cpp` (part 3) | fails: `unsupported color tile mode` | This matches the table in the description. Part 1 (`PresentDisplayBuffer`) has no test, so it has no negative control. ## Findings ### Blocking 1. **Conflicts with `main`.** Merging into `main` `b433c40f2f` conflicts in `core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp` (`ShaderStages` gained `hullWaveSize`/`tessellationGeometry` on `main` against `legacyVertex` here, and `DrawKeyRegisters` is 50 entries on `main` against 52 here), `Graphics/src/Draw.cpp` (the `linearResident` line that #9879 changed, which the description expected) and `Graphics/src/State.cpp` (`decodeDepthPlane` extent, `DecodeShaderStages` routing, `DecodeColorFormat`). Most of these hunks come from #9431, which is still open. Fix: merge `main` again once #9431 is updated, or land #9431 first. 2. **The PR head does not compile on Linux x86-64 with libstdc++.** [`PipelineJournal.cpp` L41-L42](https://github.com/boykopovar/AnyPS5/blob/375f5630ba0e7639d2b1fda7cebc609eb7767daf/core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp#L41-L42) asserts `sizeof(State) == 840` and `sizeof(ShaderStages) == 112`. On this branch they are 848 and 116, after #9431 added [`ShaderStages::legacyVertex`](https://github.com/boykopovar/AnyPS5/blob/375f5630ba0e7639d2b1fda7cebc609eb7767daf/core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp#L35). The asserts sit under `#if defined(__linux__) && defined(__x86_64__) && defined(__GLIBCXX__)`, so the Windows runs in the description and comments could not hit them. This confirms the earlier comment that reported the same failure after a merge with `main`. It fails on the PR head too, without any merge. The fix is not to bump the numbers: the recipe codec and `CanonicalPipelineState` need to carry the new field. Otherwise a pipeline restored from the journal loses `legacyVertex`. Then update the expected sizes. 3. **A non-resident GCN flip on an HDR10 swapchain throws.** The new early return at [`VulkanDevice.cpp` L3432-L3435](https://github.com/boykopovar/AnyPS5/blob/375f5630ba0e7639d2b1fda7cebc609eb7767daf/core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp#L3432-L3435) calls `present(..., pixels, nullptr, nullptr, ..., passthrough)`. That return comes before [L3455](https://github.com/boykopovar/AnyPS5/blob/375f5630ba0e7639d2b1fda7cebc609eb7767daf/core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp#L3455), `if (passthrough && resident == nullptr) ensureHdrScaler(...)`. With `passthrough` set, no resident image and pixels given, `present` has `drawn == false` and `clearOnly == false`, so [L3539](https://github.com/boykopovar/AnyPS5/blob/375f5630ba0e7639d2b1fda7cebc609eb7767daf/core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp#L3539) requires `state->hdrScaler != nullptr`. `useSurfaceFormat` resets `hdrScaler`, so the first such flip after the swapchain picks an HDR10 format fails with "an HDR10 presentation through the scaler needs the HDR10 scaler and dumps on the CPU". If an earlier flip left a scaler for another source format, the texels go through that one instead. The same early return also skips the frame-dump block (L3438) and `takeScreenshot` (L3451), so frame dumps and screenshots silently miss these flips. Fix: don't return early. Compute `pixels` for this case and fall through to the common tail, passing `pixels` instead of `&buffer`. Then the `ensureHdrScaler`, dump and screenshot handling applies to it. A `video_out_flip_ps4` case with a GCN buffer and no resident image (as requested in an earlier comment) would cover it. 4. **The display decode this path relies on is still wrong for GCN buffers.** I confirm the point raised twice in the comments: [`DisplayBuffer.cpp` L198-L199](https://github.com/boykopovar/AnyPS5/blob/375f5630ba0e7639d2b1fda7cebc609eb7767daf/core/libs/prx/libSceAgcDriver/Execution/src/DisplayBuffer.cpp#L198-L199) still uses the linear or 64 KiB PS5 formula for `DisplayTilingGcn` (value 2). Part 1 now sends every non-resident GCN flip with a 32-bit format through it in SDR. #9673 is still open and the body still says only `Depends on: #9431`. Fix: carry the `texelOffset` change or add `Depends on: #9673`. ### Non-blocking 1. [`tests/GuestTextureResource.cpp` L791](https://github.com/boykopovar/AnyPS5/blob/375f5630ba0e7639d2b1fda7cebc609eb7767daf/core/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cpp#L791): the failure message says "MIN_LOD bits", but the bits above the 38-bit base are `MTYPE_L2` (word 1 bits 6-7, `0xc0` in the test word). MIN_LOD is bits 8-19 and a 40-bit mask never reached it. Suggest "took MTYPE_L2 above its 38-bit base as address bits". 2. [`IsNullTextureResource`, `GuestTextureResource.cpp` L123](https://github.com/boykopovar/AnyPS5/blob/375f5630ba0e7639d2b1fda7cebc609eb7767daf/core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp#L123) still masks 40 bits. A PS4 T# with a zero base and a non-zero `MTYPE_L2` is reported as not null, and `DecodeTextureResource` then throws "guest texture descriptor has a null base address". Applying the same `gcn ? 0x3fffffffff : 0xffffffffff` mask there keeps the two consistent. 3. [`docs/dev/debt/libSceAgcDriver.md` L71](https://github.com/boykopovar/AnyPS5/blob/375f5630ba0e7639d2b1fda7cebc609eb7767daf/docs/dev/debt/libSceAgcDriver.md#L71) still opens with "3D and thick modes (GB_TILE_MODE 15 and 19 to 26) throw", then says a 3D surface in a thin mode is laid out. "Thick modes (GB_TILE_MODE 15 and 19 to 26) throw" would no longer contradict the next sentence. 4. Part 4 is covered by layout arithmetic in `tests/TextureTiling.cpp` only. `tests/execution/GcnDetile.cpp` has no 3D case, so no test runs the GPU detile and upload of a level-major PS4 volume with `imageDepth > 1`. A small 3D thin-mode case there would test the image creation and per-level slice counts end to end. ## Not verified - The merged tree: the merge conflicts, so everything above ran on the PR head, which is based on `main` `07da04f947`. - A build without the local change to the two `static_assert` values. - `video_out_flip_*` other than `video_out_flip_decode`: they skip here (SDL `offscreen`), so the `PresentDisplayBuffer` change was not exercised by any test I ran. - HDR10 presentation at runtime: finding 3 is from reading the code, not from a run. - No title was run. ## To get this to a good state 1. Bring the branch up to current `main` (after #9431 is updated or merged) and resolve the three conflicts. 2. Update the pipeline-journal codec and `CanonicalPipelineState` for the new `ShaderStages`/`State` fields, then the expected sizes, and build on Linux. 3. Route the non-resident GCN flip through the common tail of `PresentDisplayBuffer` so the HDR10 scaler, frame dumps and screenshots apply. Add a flip test for it. 4. Carry #9673's decode fix or list it under `Depends on`.
XairRrR commented 2026-11-02 19:48:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T19:48:06Z.

Review: APPROVED


Re-checked — approved

All four blocking findings from my last review are resolved. Since then, current main was merged in, the non-resident GCN flip goes through the common present tail, #9673's 4-byte decode fix is carried here, IsNullTextureResource and TextureResourceAllocationAddress read the 38-bit PS4 base, and GcnDetile.cpp gained a thin-mode 3D case.

What changed since my last review

My last review was of 375f5630ba. Since then:

  • main was merged in several times. #9431 is now on main, so the diff against main is only this PR's 16 files.
  • New commits:
    • 574321b323: DecodeDisplayBuffer's 4-byte loop uses texelOffset.
    • 145e53d6c2: the early return is gone, and a new agc_driver_gcn_display_present test was added.
    • 83ca6990ae: IsNullTextureResource reads the base through a shared helper.
    • 63cc6f846c: a volume case in GcnDetile.cpp.
    • 393648d082: debt text.
    • ca0255b639: 38-bit mask in descriptorBaseAddress, used by TextureResourceAllocationAddress, with a check in agc_driver_graphics.
  • The author replied point by point (2026-10-30). They did not extend video_out_flip_ps4 because VideoOut on main cannot register a tiled PS4 buffer yet. That reason is valid. The new test calls the driver's present entry point instead.

What I ran

  • PR head ca0255b639dc987f8b9a6a347646b7868a4f6346, main a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8, merged tree e5f2fcc260cc0adbd7d99e94b417b57246b8bfd0.
  • Debian 13 VM, 32 vCPU (Xeon Gold 6136), GCC 14.2.0, Release, Ninja, Vulkan through lavapipe (Mesa 26.1.6, LLVM 19), no GPU.
git diff --check a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8...ca0255b639dc987f8b9a6a347646b7868a4f6346
python3 tools/check_conventions.py --base a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8
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 -j4 -V -R '^(agc_driver_graphics|agc_driver_gcn_detile|agc_driver_gcn_display_present|agc_shader_memory)$'
# negative control 1: only the 38-bit mask in descriptorBaseAddress put back to 0xffffffffffull
ninja -C build agc_driver_graphics_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_graphics$'
# negative control 2: Graphics/src/TextureTiling.cpp and Graphics/include/TextureTiling.hpp from main
git show a4eca2a056:<path> > <path>
ninja -C build agc_driver_gcn_detile_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_gcn_detile$'
# restore from the merged tree, rebuild, rerun with the validation layer
git show e5f2fcc260:<path> > <path>
git status --porcelain     # empty
ninja -C build agc_driver_graphics_tests agc_driver_gcn_detile_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ... ctest --test-dir build -V -R '^(agc_driver_graphics|agc_driver_gcn_detile)$'
Check Result
Merge into main clean (script)
git diff --check clean
check_conventions.py All conventions checks passed.
Build on Linux/GCC 14, including PipelineJournal.cpp, whose size guards assert State == 928 and ShaderStages == 164 passes
Script's selected test run 2136 ran, 0 new failures, 0 timeouts. 7 known failures also fail on main. 2 main_sync_renames_* tests that fail on main pass here.
agc_driver_graphics, agc_driver_gcn_detile, agc_shader_memory with the validation layer pass
agc_driver_gcn_display_present skipped (SDL offscreen, no Vulkan surface)
VUID- lines / was not found but was requested 0 / 0. The loader log shows VK_LAYER_KHRONOS_validation inserted for the instance and the device.
Negative controls
# 40-bit mask back in descriptorBaseAddress only
1/1 Test #1585: agc_driver_graphics ..............***Failed   34.12 sec
AGC graphics: a PS4 T# with MTYPE_L2 set looked up its allocation at an address other than its 38-bit base

# TextureTiling.cpp/.hpp as on main
1/1 Test #1027: agc_driver_gcn_detile ............***Failed    3.97 sec
AGC graphics: PS4 3D and multisampled textures are not implemented

Previous findings

  • Blocking 1, conflicts with main: Resolved. The script merged the head into a4eca2a056 with no conflict.
  • Blocking 2, Linux build fails on the PipelineJournal.cpp size guards: Resolved. The PR no longer changes State or ShaderStages. The merged tree builds with GCC 14/libstdc++ on x86-64, where the guards at core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:44-45 are active.
  • Blocking 3, the early return skips ensureHdrScaler, frame dumps and screenshots: Resolved. I checked this by reading the code. The decoded pixels are produced at core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp:3650 and passed to the common present(...). That call comes after the dump and screenshot handling and after ensureHdrScaler at VulkanDevice.cpp:3642. The overlay plane is now passed too. The runtime check in agc_driver_gcn_display_present (SDR and HDR10) skipped here, so that run is author-reported.
  • Blocking 4, DecodeDisplayBuffer uses the PS5 formula for GCN buffers: Resolved. The 4-byte loop now uses texelOffset(buffer, x, y, 4u) (core/libs/prx/libSceAgcDriver/Execution/src/DisplayBuffer.cpp:196), like the half-float loop.
  • Non-blocking 1, "MIN_LOD" in the test message: Resolved. It now says MTYPE_L2.
  • Non-blocking 2, IsNullTextureResource reads 40 bits: Resolved. It uses descriptorBase(words), and a test pins the zero-base MTYPE_L2 case.
  • Non-blocking 3, the debt entry contradicts itself: Resolved. It now opens with "thick modes (GB_TILE_MODE 15 and 19 to 26) throw".
  • Non-blocking 4, no GPU test of a PS4 volume: Resolved. detileVolume in tests/execution/GcnDetile.cpp detiles the 6/3/1 slices in four thin modes, with and without POW2_PAD, then creates the 3D Texture. It fails with volumes refused again (negative control 2).

New findings

Blocking

None.

Non-blocking

  1. Two identical base helpers. After ca0255b639, descriptorBaseAddress (core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp:71-75) and descriptorBase (GuestTextureResource.cpp:139-141) apply the same GCN/PS5 mask. The only difference is the << 8. DecodeTextureResource calls descriptorBase(words) << 8u (GuestTextureResource.cpp:175), which is exactly descriptorBaseAddress(words). Keeping one helper would stop the decode and the allocation lookup from drifting apart again, which is the bug the last commit fixed. Suggested fix: drop descriptorBase, use descriptorBaseAddress at line 175, and use descriptorBaseAddress(words) == 0 in IsNullTextureResource.

Not verified

  • agc_driver_gcn_display_present skipped here (SDL offscreen, no Vulkan surface). It also skipped in the NVIDIA bot's runs and in the other local run reported on this PR. The SDR/HDR10 presentation, frame-dump and screenshot checks have only run on the author's RX 9070 XT.
  • The script did not compare validation output with main: its main baseline (0278ca9831) has no validation run yet. I ran agc_driver_graphics and agc_driver_gcn_detile with the layer and saw 0 VUID- lines, so there is nothing new to compare. I did not run the layer on main myself.
  • agc_driver_graphics took about 34 s here, with and without the layer. That is over the 30 s rule. The NVIDIA bot reported it at 31-32 s on earlier heads. This PR adds only a few CPU checks to it, so I don't count the time against the PR, but I did not time it on main on this machine.
  • No title was run; the titles also need #9432.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5742405641 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9891#pullrequestreview-5742405641). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T19:48:06Z. **Review:** APPROVED --- # Re-checked — approved All four blocking findings from my last review are resolved. Since then, current `main` was merged in, the non-resident GCN flip goes through the common present tail, #9673's 4-byte decode fix is carried here, `IsNullTextureResource` and `TextureResourceAllocationAddress` read the 38-bit PS4 base, and `GcnDetile.cpp` gained a thin-mode 3D case. ## What changed since my last review My last review was of `375f5630ba`. Since then: - `main` was merged in several times. #9431 is now on `main`, so the diff against `main` is only this PR's 16 files. - New commits: - `574321b323`: `DecodeDisplayBuffer`'s 4-byte loop uses `texelOffset`. - `145e53d6c2`: the early return is gone, and a new `agc_driver_gcn_display_present` test was added. - `83ca6990ae`: `IsNullTextureResource` reads the base through a shared helper. - `63cc6f846c`: a volume case in `GcnDetile.cpp`. - `393648d082`: debt text. - `ca0255b639`: 38-bit mask in `descriptorBaseAddress`, used by `TextureResourceAllocationAddress`, with a check in `agc_driver_graphics`. - The author replied point by point (2026-10-30). They did not extend `video_out_flip_ps4` because VideoOut on `main` cannot register a tiled PS4 buffer yet. That reason is valid. The new test calls the driver's present entry point instead. ## What I ran - PR head `ca0255b639dc987f8b9a6a347646b7868a4f6346`, `main` `a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8`, merged tree `e5f2fcc260cc0adbd7d99e94b417b57246b8bfd0`. - Debian 13 VM, 32 vCPU (Xeon Gold 6136), GCC 14.2.0, Release, Ninja, Vulkan through lavapipe (Mesa 26.1.6, LLVM 19), no GPU. ```sh git diff --check a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8...ca0255b639dc987f8b9a6a347646b7868a4f6346 python3 tools/check_conventions.py --base a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8 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 -j4 -V -R '^(agc_driver_graphics|agc_driver_gcn_detile|agc_driver_gcn_display_present|agc_shader_memory)$' # negative control 1: only the 38-bit mask in descriptorBaseAddress put back to 0xffffffffffull ninja -C build agc_driver_graphics_tests ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_graphics$' # negative control 2: Graphics/src/TextureTiling.cpp and Graphics/include/TextureTiling.hpp from main git show a4eca2a056:<path> > <path> ninja -C build agc_driver_gcn_detile_tests ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_gcn_detile$' # restore from the merged tree, rebuild, rerun with the validation layer git show e5f2fcc260:<path> > <path> git status --porcelain # empty ninja -C build agc_driver_graphics_tests agc_driver_gcn_detile_tests VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ... ctest --test-dir build -V -R '^(agc_driver_graphics|agc_driver_gcn_detile)$' ``` | Check | Result | |---|---| | Merge into `main` | clean (script) | | `git diff --check` | clean | | `check_conventions.py` | `All conventions checks passed.` | | Build on Linux/GCC 14, including `PipelineJournal.cpp`, whose size guards assert `State == 928` and `ShaderStages == 164` | passes | | Script's selected test run | 2136 ran, 0 new failures, 0 timeouts. 7 known failures also fail on `main`. 2 `main_sync_renames_*` tests that fail on `main` pass here. | | `agc_driver_graphics`, `agc_driver_gcn_detile`, `agc_shader_memory` with the validation layer | pass | | `agc_driver_gcn_display_present` | skipped (SDL `offscreen`, no Vulkan surface) | | `VUID-` lines / `was not found but was requested` | 0 / 0. The loader log shows `VK_LAYER_KHRONOS_validation` inserted for the instance and the device. | <details><summary>Negative controls</summary> ```text # 40-bit mask back in descriptorBaseAddress only 1/1 Test #1585: agc_driver_graphics ..............***Failed 34.12 sec AGC graphics: a PS4 T# with MTYPE_L2 set looked up its allocation at an address other than its 38-bit base # TextureTiling.cpp/.hpp as on main 1/1 Test #1027: agc_driver_gcn_detile ............***Failed 3.97 sec AGC graphics: PS4 3D and multisampled textures are not implemented ``` </details> ## Previous findings - **Blocking 1, conflicts with `main`: Resolved.** The script merged the head into `a4eca2a056` with no conflict. - **Blocking 2, Linux build fails on the `PipelineJournal.cpp` size guards: Resolved.** The PR no longer changes `State` or `ShaderStages`. The merged tree builds with GCC 14/libstdc++ on x86-64, where the guards at `core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:44-45` are active. - **Blocking 3, the early return skips `ensureHdrScaler`, frame dumps and screenshots: Resolved.** I checked this by reading the code. The decoded pixels are produced at `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp:3650` and passed to the common `present(...)`. That call comes after the dump and screenshot handling and after `ensureHdrScaler` at `VulkanDevice.cpp:3642`. The overlay `plane` is now passed too. The runtime check in `agc_driver_gcn_display_present` (SDR and HDR10) skipped here, so that run is author-reported. - **Blocking 4, `DecodeDisplayBuffer` uses the PS5 formula for GCN buffers: Resolved.** The 4-byte loop now uses `texelOffset(buffer, x, y, 4u)` (`core/libs/prx/libSceAgcDriver/Execution/src/DisplayBuffer.cpp:196`), like the half-float loop. - **Non-blocking 1, "MIN_LOD" in the test message: Resolved.** It now says MTYPE_L2. - **Non-blocking 2, `IsNullTextureResource` reads 40 bits: Resolved.** It uses `descriptorBase(words)`, and a test pins the zero-base MTYPE_L2 case. - **Non-blocking 3, the debt entry contradicts itself: Resolved.** It now opens with "thick modes (GB_TILE_MODE 15 and 19 to 26) throw". - **Non-blocking 4, no GPU test of a PS4 volume: Resolved.** `detileVolume` in `tests/execution/GcnDetile.cpp` detiles the 6/3/1 slices in four thin modes, with and without POW2_PAD, then creates the 3D `Texture`. It fails with volumes refused again (negative control 2). ## New findings ### Blocking None. ### Non-blocking 1. **Two identical base helpers.** After `ca0255b639`, `descriptorBaseAddress` (`core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp:71-75`) and `descriptorBase` (`GuestTextureResource.cpp:139-141`) apply the same GCN/PS5 mask. The only difference is the `<< 8`. `DecodeTextureResource` calls `descriptorBase(words) << 8u` (`GuestTextureResource.cpp:175`), which is exactly `descriptorBaseAddress(words)`. Keeping one helper would stop the decode and the allocation lookup from drifting apart again, which is the bug the last commit fixed. Suggested fix: drop `descriptorBase`, use `descriptorBaseAddress` at line 175, and use `descriptorBaseAddress(words) == 0` in `IsNullTextureResource`. ## Not verified - `agc_driver_gcn_display_present` skipped here (SDL `offscreen`, no Vulkan surface). It also skipped in the NVIDIA bot's runs and in the other local run reported on this PR. The SDR/HDR10 presentation, frame-dump and screenshot checks have only run on the author's RX 9070 XT. - The script did not compare validation output with `main`: its `main` baseline (`0278ca9831`) has no validation run yet. I ran `agc_driver_graphics` and `agc_driver_gcn_detile` with the layer and saw 0 `VUID-` lines, so there is nothing new to compare. I did not run the layer on `main` myself. - `agc_driver_graphics` took about 34 s here, with and without the layer. That is over the 30 s rule. The NVIDIA bot reported it at 31-32 s on earlier heads. This PR adds only a few CPU checks to it, so I don't count the time against the PR, but I did not time it on `main` on this machine. - No title was run; the titles also need #9432. <!-- anyps5-bots job=2234 head=ca0255b639dc987f8b9a6a347646b7868a4f6346 -->
XairRrR commented 2026-11-03 19:33:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T19:33:20Z.

Review: APPROVED


Re-checked — approved

Since my last review, main 1e658521a0 was merged in (9b9288abc8) and a test-only commit (cebb30f132) was pushed. The merged tree builds, the focused tests pass and the negative control still fails. The one new VUID- the script flagged comes from main, not from this PR.

What changed since my last review

My last review was of ca0255b639. Since then:

  • 9b9288abc8 merges main 1e658521a0. The PR's eleven own commits are unchanged (delta.patch shows them all as =). The only conflict was in docs/dev/debt/libSceAgcDriver.md. The resolution keeps both sides: this branch's thick-and-layered, array-layer-bank and non-resident-flip entries, and main's render-target entry with its PS4 depth-target sentence.

  • cebb30f132 (test only, after RNK123's comment) adds three asserts to detileVolume in tests/execution/GcnDetile.cpp:

    • level 1 starts after the 6 level 0 slices;
    • level 2 starts after 3 level 1 slices, or 4 with POW2_PAD;
    • guestBytes ends after the one level 2 slice.

    The script built and tested 9b9288abc8, so this commit is not in the tree I ran (see Not verified). I read its diff. The asserts are host-side and check what the commit message says. GcnDetile.cpp is a test file, so no debt doc change is needed.

What I ran

PR head 9b9288abc84fafb1530018d7c6a26ae8895dc0f2, main 086c0686c8adff3ee648fdbe34e0b0b647e1d511, merged tree 0afca9fbedbfef7aa5655089829115b4ec2b32e5. Debian 13 VM, 32 vCPU (Xeon Gold 6136), GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6), no GPU.

git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...9b9288abc84fafb1530018d7c6a26ae8895dc0f2
python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511
# where the new VUID in agc_driver_image_gather_volume comes from
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
  ctest --test-dir build -V -R '^agc_driver_image_gather_volume$'
# restore the PR's 10 production files from main (DisplayBuffer.cpp, VulkanDevice.cpp, ColorTargetLayout.hpp/.cpp,
# TextureTiling.hpp/.cpp, ColorTargetTransfer.cpp, Draw.cpp, GuestTextureResource.cpp, State.cpp)
git show 086c0686c8:<path> > <path>
ninja -C build -j32 -l32 agc_driver_image_gather_volume_tests agc_driver_gcn_detile_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ... ctest --test-dir build -V -R '^agc_driver_image_gather_volume$'
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_gcn_detile$'
# restore the merged tree
git show 0afca9fbed:<path> > <path>
git status --porcelain     # empty
ninja -C build -j32 -l32 agc_driver_gcn_detile_tests agc_driver_image_gather_volume_tests agc_driver_graphics_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 -j4 -V -R '^(agc_driver_gcn_detile|agc_driver_graphics|agc_driver_gcn_display_present)$'
Check Result
Merge into main clean (script)
git diff --check clean
check_conventions.py All conventions checks passed.
Build (script) passes
Script's selected tests 2239 ran, 0 new failures, 0 timeouts. 7 known failures also fail on main.
Script's validation comparison 783 tests, layer loaded in 782, none missing. One test with new VUID- lines: agc_driver_image_gather_volume, marked "test not run on main".
agc_driver_image_gather_volume with the PR's production files restored from main the same 4 VkSamplerCreateInfo VUIDs, so they come from main
agc_driver_gcn_detile, agc_driver_graphics with the layer (merged tree) pass, 0 Validation Error, layer inserted for the instance and the device
agc_driver_gcn_display_present skipped (SDL offscreen, no Vulkan surface)
The gather-volume VUIDs come from main

agc_driver_image_gather_volume arrived on main with #9183 (0bf0563442), after the script's validation baseline 1e658521a0. That is why the script marks it "test not run on main". With the PR's production files restored from main:

1/1 Test #1237: agc_driver_image_gather_volume ...   Passed    9.60 sec
Validation Error: [ VUID-VkSamplerCreateInfo-addressModeU-01079 ]
Validation Error: [ VUID-VkSamplerCreateInfo-addressModeU-parameter ]
Validation Error: [ VUID-VkSamplerCreateInfo-addressModeV-parameter ]
Validation Error: [ VUID-VkSamplerCreateInfo-addressModeW-parameter ]

These are the same four IDs as on the merged tree, so they are not counted against this PR.

Negative control (PR production files from main)
1/1 Test #1194: agc_driver_gcn_detile ............***Failed    4.05 sec
AGC graphics: PS4 3D and multisampled textures are not implemented

Previous findings

  • Non-blocking 1, two identical base helpers: Still open. descriptorBaseAddress (core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp:71) and descriptorBase (GuestTextureResource.cpp:139) still apply the same mask. DecodeTextureResource still uses descriptorBase(words) << 8u at line 183. This does not block the merge, but a single helper would keep the decode and the allocation lookup from drifting apart.

All earlier blocking findings stay resolved: the merge is clean, the build passes, the common present tail is used, and the GCN decode goes through texelOffset.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • cebb30f132 was not built or run here. The script's tree is the merge of 9b9288abc8. That commit only adds three host-side asserts to GcnDetile.cpp, and I read them. The author reports that agc_driver_gcn_detile passes 3/3 with them on an RX 9070 XT, and that each of four TextureTiling.cpp mutations fails one of them. That evidence is author-reported.
  • agc_driver_gcn_display_present skipped again (no Vulkan surface under SDL offscreen). The SDR/HDR10 presentation, frame-dump and screenshot checks have only been run by the author.
  • agc_driver_graphics took 35.5 s here with the layer, over the 30 s rule, as in my previous review. The PR adds only a few CPU checks to it, and I did not time it on main.
  • No title was run; the titles also need #9432.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5758353635 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9891#pullrequestreview-5758353635). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T19:33:20Z. **Review:** APPROVED --- # Re-checked — approved Since my last review, `main` `1e658521a0` was merged in (`9b9288abc8`) and a test-only commit (`cebb30f132`) was pushed. The merged tree builds, the focused tests pass and the negative control still fails. The one new `VUID-` the script flagged comes from `main`, not from this PR. ## What changed since my last review My last review was of `ca0255b639`. Since then: - **`9b9288abc8`** merges `main` `1e658521a0`. The PR's eleven own commits are unchanged (delta.patch shows them all as `=`). The only conflict was in `docs/dev/debt/libSceAgcDriver.md`. The resolution keeps both sides: this branch's thick-and-layered, array-layer-bank and non-resident-flip entries, and `main`'s render-target entry with its PS4 depth-target sentence. - **`cebb30f132`** (test only, after RNK123's comment) adds three asserts to `detileVolume` in `tests/execution/GcnDetile.cpp`: - level 1 starts after the 6 level 0 slices; - level 2 starts after 3 level 1 slices, or 4 with `POW2_PAD`; - `guestBytes` ends after the one level 2 slice. The script built and tested `9b9288abc8`, so this commit is not in the tree I ran (see Not verified). I read its diff. The asserts are host-side and check what the commit message says. `GcnDetile.cpp` is a test file, so no debt doc change is needed. ## What I ran PR head `9b9288abc84fafb1530018d7c6a26ae8895dc0f2`, `main` `086c0686c8adff3ee648fdbe34e0b0b647e1d511`, merged tree `0afca9fbedbfef7aa5655089829115b4ec2b32e5`. Debian 13 VM, 32 vCPU (Xeon Gold 6136), GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6), no GPU. ```sh git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...9b9288abc84fafb1530018d7c6a26ae8895dc0f2 python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511 # where the new VUID in agc_driver_image_gather_volume comes from VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \ ctest --test-dir build -V -R '^agc_driver_image_gather_volume$' # restore the PR's 10 production files from main (DisplayBuffer.cpp, VulkanDevice.cpp, ColorTargetLayout.hpp/.cpp, # TextureTiling.hpp/.cpp, ColorTargetTransfer.cpp, Draw.cpp, GuestTextureResource.cpp, State.cpp) git show 086c0686c8:<path> > <path> ninja -C build -j32 -l32 agc_driver_image_gather_volume_tests agc_driver_gcn_detile_tests VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ... ctest --test-dir build -V -R '^agc_driver_image_gather_volume$' ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_gcn_detile$' # restore the merged tree git show 0afca9fbed:<path> > <path> git status --porcelain # empty ninja -C build -j32 -l32 agc_driver_gcn_detile_tests agc_driver_image_gather_volume_tests agc_driver_graphics_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 -j4 -V -R '^(agc_driver_gcn_detile|agc_driver_graphics|agc_driver_gcn_display_present)$' ``` | Check | Result | |---|---| | Merge into `main` | clean (script) | | `git diff --check` | clean | | `check_conventions.py` | `All conventions checks passed.` | | Build (script) | passes | | Script's selected tests | 2239 ran, 0 new failures, 0 timeouts. 7 known failures also fail on `main`. | | Script's validation comparison | 783 tests, layer loaded in 782, none missing. One test with new `VUID-` lines: `agc_driver_image_gather_volume`, marked "test not run on main". | | `agc_driver_image_gather_volume` with the PR's production files restored from `main` | the same 4 `VkSamplerCreateInfo` VUIDs, so they come from `main` | | `agc_driver_gcn_detile`, `agc_driver_graphics` with the layer (merged tree) | pass, 0 `Validation Error`, layer inserted for the instance and the device | | `agc_driver_gcn_display_present` | skipped (SDL `offscreen`, no Vulkan surface) | <details><summary>The gather-volume VUIDs come from main</summary> `agc_driver_image_gather_volume` arrived on `main` with #9183 (`0bf0563442`), after the script's validation baseline `1e658521a0`. That is why the script marks it "test not run on main". With the PR's production files restored from `main`: ```text 1/1 Test #1237: agc_driver_image_gather_volume ... Passed 9.60 sec Validation Error: [ VUID-VkSamplerCreateInfo-addressModeU-01079 ] Validation Error: [ VUID-VkSamplerCreateInfo-addressModeU-parameter ] Validation Error: [ VUID-VkSamplerCreateInfo-addressModeV-parameter ] Validation Error: [ VUID-VkSamplerCreateInfo-addressModeW-parameter ] ``` These are the same four IDs as on the merged tree, so they are not counted against this PR. </details> <details><summary>Negative control (PR production files from main)</summary> ```text 1/1 Test #1194: agc_driver_gcn_detile ............***Failed 4.05 sec AGC graphics: PS4 3D and multisampled textures are not implemented ``` </details> ## Previous findings - **Non-blocking 1, two identical base helpers: Still open.** `descriptorBaseAddress` (`core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp:71`) and `descriptorBase` (`GuestTextureResource.cpp:139`) still apply the same mask. `DecodeTextureResource` still uses `descriptorBase(words) << 8u` at line 183. This does not block the merge, but a single helper would keep the decode and the allocation lookup from drifting apart. All earlier blocking findings stay resolved: the merge is clean, the build passes, the common present tail is used, and the GCN decode goes through `texelOffset`. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - **`cebb30f132` was not built or run here.** The script's tree is the merge of `9b9288abc8`. That commit only adds three host-side asserts to `GcnDetile.cpp`, and I read them. The author reports that `agc_driver_gcn_detile` passes 3/3 with them on an RX 9070 XT, and that each of four `TextureTiling.cpp` mutations fails one of them. That evidence is author-reported. - **`agc_driver_gcn_display_present` skipped again** (no Vulkan surface under SDL `offscreen`). The SDR/HDR10 presentation, frame-dump and screenshot checks have only been run by the author. - **`agc_driver_graphics` took 35.5 s here with the layer**, over the 30 s rule, as in my previous review. The PR adds only a few CPU checks to it, and I did not time it on `main`. - No title was run; the titles also need #9432. <!-- anyps5-bots job=3550 head=9b9288abc84fafb1530018d7c6a26ae8895dc0f2 -->
XairRrR commented 2026-11-03 19:56:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T19:56:48Z.

Review: APPROVED


Re-checked — approved

The only change since my last review is the test-only commit cebb30f132, which adds level-offset asserts to the PS4 volume case of agc_driver_gcn_detile. It is now in the merged tree. It builds, passes with the validation layer and fails under a slice-count mutation. There is one non-blocking issue: when the second volume of a mode fails, the test crashes while unwinding instead of printing its message.

What changed since my last review

I last reviewed 9b9288abc8. The script built and tested that commit, without cebb30f132, so last time I only read this commit's diff. delta.patch shows the PR's 11 earlier commits unchanged (=). The only new commit is cebb30f132, which adds three host-side asserts to detileVolume (core/libs/prx/libSceAgcDriver/tests/execution/GcnDetile.cpp:98-100). The description gained a "Level offsets, 3 Nov." paragraph. There are no new author replies to my review.

What I ran

PR head cebb30f1323bc3a57657d9147aa8e6d03c86014e, main 086c0686c8adff3ee648fdbe34e0b0b647e1d511, merged tree dbde32d139517db378e52d9fdb7e44e1319e1c84. Debian 13 VM, 32 vCPU (Xeon Gold 6136), GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6), no GPU.

git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...cebb30f1323bc3a57657d9147aa8e6d03c86014e
python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511
ninja -C build -j32 -l32 agc_driver_gcn_detile_tests agc_driver_graphics_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 -V -R '^agc_driver_gcn_detile$'
# mutation A, in TextureTiling.cpp GcnLevelSlices: "if (!volume || level == 0) return slices;" -> "return slices;"
ninja -C build -j32 -l32 agc_driver_gcn_detile_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_gcn_detile$'
git show dbde32d139:core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
# mutation B: "return pow2Pad ? std::bit_ceil(levelSlices) : levelSlices;" -> "return levelSlices;"
ninja -C build -j32 -l32 agc_driver_gcn_detile_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_gcn_detile$'
ANYPS5_REQUIRE_VULKAN=1 build/tests/agc_driver_gcn_detile_tests
git show dbde32d139:core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
git status --porcelain     # empty
ninja -C build -j32 -l32 agc_driver_gcn_detile_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R '^agc_driver_gcn_detile$'
Check Result
Merge into main clean (script)
git diff --check clean
check_conventions.py All conventions checks passed.
Build (script, and the two test targets here) passes
Script's selected tests 2239 ran: 0 new failures, 0 timeouts, 7 known failures that also fail on main
Script's validation comparison 783 tests, layer loaded in 782, missing in none. The only new VUID- lines are in agc_driver_image_gather_volume, marked "test not run on main". Last time I showed they come from main (#9183): the same four VkSamplerCreateInfo IDs appear with this PR's production files restored from main. Nothing in this push touches that path.
agc_driver_gcn_detile with the layer passes in 5.8 s. 0 VUID-/Validation Error lines. The layer was inserted for both the instance and the device.
Mutation A (all slices kept at levels 1 and 2) fails: PS4 volume in tile mode 15: level 2 does not start after 3 level 1 slices
Mutation B (no POW2_PAD rounding) fails, but with exit 139 (SEGFAULT) and no message, see the non-blocking finding
Restored tree git status --porcelain is empty, and agc_driver_gcn_detile passes again

Negative control

The commit adds test asserts only. Restoring the PR's production files from main still fails the volume case with "PS4 3D and multisampled textures are not implemented", as in my last review. The new asserts target the slice count per level, so I also mutated GcnLevelSlices in two ways (table above). Both mutations make the test fail. The author's report that the fixture without this commit passes these mutations matches RNK123's control. I did not repeat that run.

Previous findings

  • Non-blocking: two identical base helpers. Still open. descriptorBaseAddress (core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp:71) and descriptorBase (GuestTextureResource.cpp:139) still apply the same mask. DecodeTextureResource uses descriptorBase(words) << 8u at line 183. This does not block the merge.
  • Not verified last time: cebb30f132 was not built or run. Resolved. It is now built and run here (see Results).

New findings

Blocking

None.

Non-blocking

  1. A failure on the second volume of a mode crashes the test instead of reporting it (core/libs/prx/libSceAgcDriver/tests/execution/GcnDetile.cpp:171-173).
    • What happens: with mutation B, the POW2_PAD=false volume completes. The POW2_PAD=true volume then throws at line 99. Unwinding ends in a segfault (exit 139) before main's catch prints the message, so ctest shows only (SEGFAULT). The author saw VUID-vkEndCommandBuffer-commandBuffer-00059 on the same path on Windows.
    • Why it happens: the device->WaitIdle() the PR added at line 173 runs only on the success path. The previous volume's Texture uploads can still be in flight when the exception unwinds detiler and the device.
    • Why it matters: the test still fails, so a regression is not missed, but it is harder to diagnose.
    • Suggested fix: call context/device wait-idle at the end of detileVolume, or in main's catch before the device is reset.

Not verified

  • agc_driver_gcn_display_present was not re-run. This push changes nothing on its path, and without a Vulkan surface (SDL offscreen) it skipped here before.
  • I ran no other hardware vendor. The RX 9070 XT runs of this commit are author-reported, and RNK123 ran the fixture on RADV.
  • I ran no title.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5758645303 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9891#pullrequestreview-5758645303). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T19:56:48Z. **Review:** APPROVED --- # Re-checked — approved The only change since my last review is the test-only commit `cebb30f132`, which adds level-offset asserts to the PS4 volume case of `agc_driver_gcn_detile`. It is now in the merged tree. It builds, passes with the validation layer and fails under a slice-count mutation. There is one non-blocking issue: when the second volume of a mode fails, the test crashes while unwinding instead of printing its message. ## What changed since my last review I last reviewed `9b9288abc8`. The script built and tested that commit, without `cebb30f132`, so last time I only read this commit's diff. delta.patch shows the PR's 11 earlier commits unchanged (`=`). The only new commit is `cebb30f132`, which adds three host-side asserts to `detileVolume` (`core/libs/prx/libSceAgcDriver/tests/execution/GcnDetile.cpp:98-100`). The description gained a "Level offsets, 3 Nov." paragraph. There are no new author replies to my review. ## What I ran PR head `cebb30f1323bc3a57657d9147aa8e6d03c86014e`, `main` `086c0686c8adff3ee648fdbe34e0b0b647e1d511`, merged tree `dbde32d139517db378e52d9fdb7e44e1319e1c84`. Debian 13 VM, 32 vCPU (Xeon Gold 6136), GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6), no GPU. ```sh git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...cebb30f1323bc3a57657d9147aa8e6d03c86014e python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511 ninja -C build -j32 -l32 agc_driver_gcn_detile_tests agc_driver_graphics_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 -V -R '^agc_driver_gcn_detile$' # mutation A, in TextureTiling.cpp GcnLevelSlices: "if (!volume || level == 0) return slices;" -> "return slices;" ninja -C build -j32 -l32 agc_driver_gcn_detile_tests ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_gcn_detile$' git show dbde32d139:core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp # mutation B: "return pow2Pad ? std::bit_ceil(levelSlices) : levelSlices;" -> "return levelSlices;" ninja -C build -j32 -l32 agc_driver_gcn_detile_tests ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_gcn_detile$' ANYPS5_REQUIRE_VULKAN=1 build/tests/agc_driver_gcn_detile_tests git show dbde32d139:core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp git status --porcelain # empty ninja -C build -j32 -l32 agc_driver_gcn_detile_tests ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R '^agc_driver_gcn_detile$' ``` | Check | Result | |---|---| | Merge into `main` | clean (script) | | `git diff --check` | clean | | `check_conventions.py` | `All conventions checks passed.` | | Build (script, and the two test targets here) | passes | | Script's selected tests | 2239 ran: 0 new failures, 0 timeouts, 7 known failures that also fail on `main` | | Script's validation comparison | 783 tests, layer loaded in 782, missing in none. The only new `VUID-` lines are in `agc_driver_image_gather_volume`, marked "test not run on main". Last time I showed they come from `main` (#9183): the same four `VkSamplerCreateInfo` IDs appear with this PR's production files restored from `main`. Nothing in this push touches that path. | | `agc_driver_gcn_detile` with the layer | passes in 5.8 s. 0 `VUID-`/`Validation Error` lines. The layer was inserted for both the instance and the device. | | Mutation A (all slices kept at levels 1 and 2) | fails: `PS4 volume in tile mode 15: level 2 does not start after 3 level 1 slices` | | Mutation B (no `POW2_PAD` rounding) | fails, but with exit 139 (SEGFAULT) and no message, see the non-blocking finding | | Restored tree | `git status --porcelain` is empty, and `agc_driver_gcn_detile` passes again | ### Negative control The commit adds test asserts only. Restoring the PR's production files from `main` still fails the volume case with "PS4 3D and multisampled textures are not implemented", as in my last review. The new asserts target the slice count per level, so I also mutated `GcnLevelSlices` in two ways (table above). Both mutations make the test fail. The author's report that the fixture without this commit passes these mutations matches RNK123's control. I did not repeat that run. ## Previous findings - **Non-blocking: two identical base helpers. Still open.** `descriptorBaseAddress` (`core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp:71`) and `descriptorBase` (`GuestTextureResource.cpp:139`) still apply the same mask. `DecodeTextureResource` uses `descriptorBase(words) << 8u` at line 183. This does not block the merge. - **Not verified last time: `cebb30f132` was not built or run. Resolved.** It is now built and run here (see Results). ## New findings ### Blocking None. ### Non-blocking 1. **A failure on the second volume of a mode crashes the test instead of reporting it** (`core/libs/prx/libSceAgcDriver/tests/execution/GcnDetile.cpp:171-173`). - **What happens:** with mutation B, the `POW2_PAD=false` volume completes. The `POW2_PAD=true` volume then throws at line 99. Unwinding ends in a segfault (exit 139) before `main`'s `catch` prints the message, so ctest shows only `(SEGFAULT)`. The author saw `VUID-vkEndCommandBuffer-commandBuffer-00059` on the same path on Windows. - **Why it happens:** the `device->WaitIdle()` the PR added at line 173 runs only on the success path. The previous volume's `Texture` uploads can still be in flight when the exception unwinds `detiler` and the device. - **Why it matters:** the test still fails, so a regression is not missed, but it is harder to diagnose. - **Suggested fix:** call `context`/device wait-idle at the end of `detileVolume`, or in `main`'s `catch` before the device is reset. ## Not verified - `agc_driver_gcn_display_present` was not re-run. This push changes nothing on its path, and without a Vulkan surface (SDL `offscreen`) it skipped here before. - I ran no other hardware vendor. The RX 9070 XT runs of this commit are author-reported, and RNK123 ran the fixture on RADV. - I ran no title. <!-- anyps5-bots job=3563 head=cebb30f1323bc3a57657d9147aa8e6d03c86014e -->
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!9891
No description provided.