fix(agc): serve views of arrays past maxImageArrayLayers from their viewed slices #6772

Merged
XairRrR merged 4 commits from upstream-pr/6772 into main 2026-10-20 08:55:10 +00:00
XairRrR commented 2026-10-16 11:22:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-16T11:22:52Z.


What

A PS5 texture array may hold up to 8192 layers; Vulkan devices allow fewer (maxImageArrayLayers is 2048 on NVIDIA). A storage view of such an array created the whole array's image anyway: vkCreateImage with more layers than the device allows is invalid (VUID-VkImageCreateInfo-arrayLayers-02256), and a shader store into a layer the device did not back faults the GPU.

Uncharted: Legacy of Thieves Collection (PPSA05684, #4001) binds a 16x16 R8G8B8A8_UNORM array (kStandard64KB, 2 mips) of up to 7809 layers as a storage image, in windows of a few hundred to 2048 slices (for example layers 1536..3200, created as a 3201-layer image). A few minutes into its orphanage chapter the device was lost: Xid 109 CTX SWITCH TIMEOUT, then VK_EXT_device_fault reported write invalid at a page-aligned address. The validation layer named the cause (arrayLayers (3201) exceeds the maxArrayLayers (2048)).

ArrayLayerWindow (TextureTiling.cpp) describes the viewed slices [baseArray, depthOrLastArray] as an array of their own, starting at the first viewed slice, when the whole array is past the limit. A non-XOR swizzle does not depend on the slice index, so those slices detile exactly as in the whole array. cachedStorageTexture uses it for every storage view and cachedTexture for every sampled view; a 3D volume is not an array and a 2D image is one layer whatever its last array field holds, so both pass unchanged. A view whose slices alone exceed the limit, a view of an XOR swizzle whose equation mixes in the slice, and any other Texture or StorageTexture image past the limit throw instead of creating an invalid image. The sampled lookup throws before it reads the surface: the same menu samples that array through image-table T#s whose views span 2689 to 8065 slices, and reading and snapshotting the whole surface (~8 MB) before the Texture constructor refused it cost ~55 ms per frame on the async queue.

#6481 checks sampled image-table entries against the device's image limits before reading them; this serves the views that fit from their slices (sampled and storage) and refuses the rest at the lookup. If #6481 lands first, its layer check should see the windowed descriptor (ArrayLayerWindow) so a fitting view of a larger array is not refused.

Tested

  • Linux (Arch, kernel 7.2.9), RTX 4070 Ti SUPER, driver 615.78.08.
  • agc_driver_graphics: ArrayLayerWindow rebases a 3201-layer view at slice 1536 to 1665 slices at base + 1536 * layerBytes with the same slice layout, keeps an array within the limit, rebases a linear array, refuses a window wider than the limit, an XOR swizzle and a cube, and passes a volume deeper than the limit and a 2D image with a large last-array field unchanged.
  • New agc_driver_image_array_window_past_layer_limit: a compute shader samples (image_sample_lz) and loads (image_load) slices 8100-8102 of an 8103-layer 1D array and reads exactly those slices; before this change the sampled lookup threw "a texture array with more layers than maxImageArrayLayers is not implemented". A view of all 8103 layers is refused with the window's error on a device whose limit is lower.
  • Related tests pass: agc_driver_graphics, agc_driver_image_one_dimensional_array, agc_driver_image_gather_one_dimensional_array, agc_driver_image_store_array_through_volume, agc_driver_array_layer_target, agc_driver_layered_volume_draw, agc_driver_depth_plane_sampling, agc_driver_depth_plane_guest_layers; conventions and test registration checks pass.
  • Uncharted: Legacy of Thieves Collection (PPSA05684) main menu on the local integration build (main + open PRs), RTX 4070 Ti SUPER, NVIDIA 615.78.08, three 60 s menu-only runs: 8.74 / 8.87 / 9.00 fps with this commit against 4.93-7.12 without it; the "keeps the snapshot path" fallback went from 19-30 per run to 0, async-queue resource completion from 72.6 to 1.7-1.8 ms per frame. The menu frames are unchanged (and match builds from before #6772).
  • All agc_ tests pass except agc_driver_store_over_untracked, which fails on unchanged main on this machine too.
  • Uncharted: Legacy of Thieves Collection (PPSA05684, #4001), orphanage chapter, automated run with the same slice window applied: no device loss in 16 minutes (it was lost within 1 to 15 minutes before); the storage view windows were served from their slices.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed 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
  • Unblocks: PPSA05684 #4001
  • GPUs tested: NVIDIA RTX 4070 Ti SUPER, driver 615.78.08, Linux
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4887646407 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6772). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-16T11:22:52Z. --- ### What A PS5 texture array may hold up to 8192 layers; Vulkan devices allow fewer (`maxImageArrayLayers` is 2048 on NVIDIA). A storage view of such an array created the whole array's image anyway: `vkCreateImage` with more layers than the device allows is invalid (`VUID-VkImageCreateInfo-arrayLayers-02256`), and a shader store into a layer the device did not back faults the GPU. Uncharted: Legacy of Thieves Collection (PPSA05684, #4001) binds a 16x16 `R8G8B8A8_UNORM` array (`kStandard64KB`, 2 mips) of up to 7809 layers as a storage image, in windows of a few hundred to 2048 slices (for example layers 1536..3200, created as a 3201-layer image). A few minutes into its orphanage chapter the device was lost: `Xid 109 CTX SWITCH TIMEOUT`, then `VK_EXT_device_fault` reported `write invalid` at a page-aligned address. The validation layer named the cause (`arrayLayers (3201) exceeds the maxArrayLayers (2048)`). `ArrayLayerWindow` (TextureTiling.cpp) describes the viewed slices `[baseArray, depthOrLastArray]` as an array of their own, starting at the first viewed slice, when the whole array is past the limit. A non-XOR swizzle does not depend on the slice index, so those slices detile exactly as in the whole array. `cachedStorageTexture` uses it for every storage view and `cachedTexture` for every sampled view; a 3D volume is not an array and a 2D image is one layer whatever its last array field holds, so both pass unchanged. A view whose slices alone exceed the limit, a view of an XOR swizzle whose equation mixes in the slice, and any other `Texture` or `StorageTexture` image past the limit throw instead of creating an invalid image. The sampled lookup throws before it reads the surface: the same menu samples that array through image-table T#s whose views span 2689 to 8065 slices, and reading and snapshotting the whole surface (~8 MB) before the `Texture` constructor refused it cost ~55 ms per frame on the async queue. #6481 checks sampled image-table entries against the device's image limits before reading them; this serves the views that fit from their slices (sampled and storage) and refuses the rest at the lookup. If #6481 lands first, its layer check should see the windowed descriptor (`ArrayLayerWindow`) so a fitting view of a larger array is not refused. ### Tested - Linux (Arch, kernel 7.2.9), RTX 4070 Ti SUPER, driver 615.78.08. - `agc_driver_graphics`: `ArrayLayerWindow` rebases a 3201-layer view at slice 1536 to 1665 slices at `base + 1536 * layerBytes` with the same slice layout, keeps an array within the limit, rebases a linear array, refuses a window wider than the limit, an XOR swizzle and a cube, and passes a volume deeper than the limit and a 2D image with a large last-array field unchanged. - New `agc_driver_image_array_window_past_layer_limit`: a compute shader samples (`image_sample_lz`) and loads (`image_load`) slices 8100-8102 of an 8103-layer 1D array and reads exactly those slices; before this change the sampled lookup threw "a texture array with more layers than maxImageArrayLayers is not implemented". A view of all 8103 layers is refused with the window's error on a device whose limit is lower. - Related tests pass: `agc_driver_graphics`, `agc_driver_image_one_dimensional_array`, `agc_driver_image_gather_one_dimensional_array`, `agc_driver_image_store_array_through_volume`, `agc_driver_array_layer_target`, `agc_driver_layered_volume_draw`, `agc_driver_depth_plane_sampling`, `agc_driver_depth_plane_guest_layers`; conventions and test registration checks pass. - Uncharted: Legacy of Thieves Collection (PPSA05684) main menu on the local integration build (main + open PRs), RTX 4070 Ti SUPER, NVIDIA 615.78.08, three 60 s menu-only runs: 8.74 / 8.87 / 9.00 fps with this commit against 4.93-7.12 without it; the "keeps the snapshot path" fallback went from 19-30 per run to 0, async-queue resource completion from 72.6 to 1.7-1.8 ms per frame. The menu frames are unchanged (and match builds from before #6772). - All `agc_` tests pass except `agc_driver_store_over_untracked`, which fails on unchanged `main` on this machine too. - Uncharted: Legacy of Thieves Collection (PPSA05684, #4001), orphanage chapter, automated run with the same slice window applied: no device loss in 16 minutes (it was lost within 1 to 15 minutes before); the storage view windows were served from their slices. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical 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] Unblocks: PPSA05684 #4001 - [x] GPUs tested: NVIDIA RTX 4070 Ti SUPER, driver 615.78.08, Linux - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-16 11:31:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T11:31:29Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6718 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L1103
PR 6820 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L1103

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5441 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5499 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5500 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/ARCHITECTURE.md
PR 6044 docs/dev/ARCHITECTURE.md
PR 6146 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6177 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6187 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6194 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6209 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6223 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/Graphics/include/TextureTiling.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6340 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6412 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ARCHITECTURE.md
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6498 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6636 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6682 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6683 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6937 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6946 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/ARCHITECTURE.md
PR 6947 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/ARCHITECTURE.md
PR 6960 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6970 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6971 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6972 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/include/TextureTiling.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp
PR 7002 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7048 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7085 core/libs/prx/libSceAgcDriver/Graphics/include/TextureTiling.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7332 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7484 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7514 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7604 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7618 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/ARCHITECTURE.md
PR 7644 docs/dev/ARCHITECTURE.md
PR 7668 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7684 docs/dev/ARCHITECTURE.md
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7862 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7948 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 8099 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6214549171 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6772#issuecomment-6214549171). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T11:31:29Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6718](https://www.github.com/boykopovar/AnyPS5/pull/6718) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L1103](https://github.com/boykopovar/AnyPS5/blob/dcab2fe989e9828e1dce12950979fdbe3d45c04c/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L1103) | | | | [PR 6820](https://www.github.com/boykopovar/AnyPS5/pull/6820) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L1103](https://github.com/boykopovar/AnyPS5/blob/dcab2fe989e9828e1dce12950979fdbe3d45c04c/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L1103) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 4040](https://www.github.com/boykopovar/AnyPS5/pull/4040) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 5441](https://www.github.com/boykopovar/AnyPS5/pull/5441) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 5500](https://www.github.com/boykopovar/AnyPS5/pull/5500) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 5609](https://www.github.com/boykopovar/AnyPS5/pull/5609) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/ARCHITECTURE.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `docs/dev/ARCHITECTURE.md` | | [PR 6146](https://www.github.com/boykopovar/AnyPS5/pull/6146) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6177](https://www.github.com/boykopovar/AnyPS5/pull/6177) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6187](https://www.github.com/boykopovar/AnyPS5/pull/6187) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6194](https://www.github.com/boykopovar/AnyPS5/pull/6194) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6197](https://www.github.com/boykopovar/AnyPS5/pull/6197) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6202](https://www.github.com/boykopovar/AnyPS5/pull/6202) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6209](https://www.github.com/boykopovar/AnyPS5/pull/6209) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6223](https://www.github.com/boykopovar/AnyPS5/pull/6223) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6235](https://www.github.com/boykopovar/AnyPS5/pull/6235) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `core/libs/prx/libSceAgcDriver/Graphics/include/TextureTiling.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6340](https://www.github.com/boykopovar/AnyPS5/pull/6340) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/ARCHITECTURE.md` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6498](https://www.github.com/boykopovar/AnyPS5/pull/6498) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6539](https://www.github.com/boykopovar/AnyPS5/pull/6539) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6548](https://www.github.com/boykopovar/AnyPS5/pull/6548) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6636](https://www.github.com/boykopovar/AnyPS5/pull/6636) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6682](https://www.github.com/boykopovar/AnyPS5/pull/6682) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6683](https://www.github.com/boykopovar/AnyPS5/pull/6683) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6937](https://www.github.com/boykopovar/AnyPS5/pull/6937) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`docs/dev/ARCHITECTURE.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`docs/dev/ARCHITECTURE.md` | | [PR 6960](https://www.github.com/boykopovar/AnyPS5/pull/6960) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6970](https://www.github.com/boykopovar/AnyPS5/pull/6970) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6971](https://www.github.com/boykopovar/AnyPS5/pull/6971) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6972](https://www.github.com/boykopovar/AnyPS5/pull/6972) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/libs/prx/libSceAgcDriver/Graphics/include/TextureTiling.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp` | | [PR 7002](https://www.github.com/boykopovar/AnyPS5/pull/7002) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 7048](https://www.github.com/boykopovar/AnyPS5/pull/7048) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 7085](https://www.github.com/boykopovar/AnyPS5/pull/7085) | `core/libs/prx/libSceAgcDriver/Graphics/include/TextureTiling.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 7256](https://www.github.com/boykopovar/AnyPS5/pull/7256) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 7484](https://www.github.com/boykopovar/AnyPS5/pull/7484) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7514](https://www.github.com/boykopovar/AnyPS5/pull/7514) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 7618](https://www.github.com/boykopovar/AnyPS5/pull/7618) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`docs/dev/ARCHITECTURE.md` | | [PR 7644](https://www.github.com/boykopovar/AnyPS5/pull/7644) | `docs/dev/ARCHITECTURE.md` | | [PR 7668](https://www.github.com/boykopovar/AnyPS5/pull/7668) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 7684](https://www.github.com/boykopovar/AnyPS5/pull/7684) | `docs/dev/ARCHITECTURE.md` | | [PR 7689](https://www.github.com/boykopovar/AnyPS5/pull/7689) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7862](https://www.github.com/boykopovar/AnyPS5/pull/7862) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 7948](https://www.github.com/boykopovar/AnyPS5/pull/7948) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 8099](https://www.github.com/boykopovar/AnyPS5/pull/8099) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` |
MarcZX10 commented 2026-10-16 11:46:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T11:46:35Z.

Review: APPROVED


Reviewed the storage-array windowing path. The code limits the requested slice window to maxImageArrayLayers, derives its guest base from the original array geometry, and rejects thick/non-array and slice-dependent XOR cases before creating the view. The layout regression checks the rebased address, slice count and mip offset, and the validation report identifies the original oversized Vulkan image. I found no blocking issue.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5547337110 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6772#pullrequestreview-5547337110). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T11:46:35Z. **Review:** APPROVED --- Reviewed the storage-array windowing path. The code limits the requested slice window to `maxImageArrayLayers`, derives its guest base from the original array geometry, and rejects thick/non-array and slice-dependent XOR cases before creating the view. The layout regression checks the rebased address, slice count and mip offset, and the validation report identifies the original oversized Vulkan image. I found no blocking issue.
Dextroid17 commented 2026-10-16 18:59:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-16T18:59:31Z.


@XairRrR thanks for this. One regression: storage views of 3D volumes deeper than 2048 texels now throw. They worked before this PR.

AGC graphics: a storage image with more layers than maxImageArrayLayers that is not a 1D or 2D array is not implemented

Cause: StorageArrayWindow returns early only when depthOrLastArray < maxArrayLayers (core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp:439). For a k3D descriptor, depthOrLastArray is depth minus one, not a last array slice: DescribeSurface makes the image imageDepth = depthOrLastArray + 1 with imageLayers = 1. Vulkan requires arrayLayers to be 1 for a 3D image and limits its depth by maxImageDimension3D (4096 on lavapipe), not by maxImageArrayLayers (2048). A volume 2049 to 4096 deep is therefore a valid image, but it now fails at the next Require. cachedStorageTexture calls StorageArrayWindow for every storage image binding, so by reading this covers any storage use of such a volume, not only the case I ran. The PR description lists "a volume" among the refused cases, and the new unit test checks that rejection (reject(... volume ..., "not a 1D or 2D array")), but a volume this deep was not an invalid image.

Minimal fix: let volumes pass through unchanged.

core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp:439

    if (viewed.depthOrLastArray < maxArrayLayers || viewed.dimension == TextureDimension::k3D) return viewed;

core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp:408

        Require(StorageArrayWindow(volume, 2048).baseAddress == volume.baseAddress && StorageArrayWindow(volume, 2048).depthOrLastArray == volume.depthOrLastArray, "a volume is not an array");

Repro: I copied tests/execution/ImageStoreArrayThroughVolume.cpp and changed Depth from 2 to 2049, with an 8 MiB guest block to hold it. It is the same compute store of a 2D-array view through a linear 3D volume descriptor, and it checks the same 32 stored texels and that the bytes past the volume are unchanged.

tree deep-volume probe (depth 2049) agc_driver_graphics
PR head dfeb3d8e5 3/3 fail, error above 3/3 pass
head with ShaderResources.cpp + Texture.cpp taken from the merge base 3f171d03e 3/3 pass, all 32 texels correct not run
head + the two suggestions above 3/3 pass 3/3 pass

Everything else checked out:

  • Your new test passes 3/3 on head and fails 3/3 with the production change reverted and StorageArrayWindow stubbed to return its input ("must start at its first viewed slice").
  • Merged with main at 16a0f509a, agc_driver_graphics passes 3/3. It still merges cleanly (git merge-tree) with main at c84249186.
  • check_conventions.py passes.

I did not check whether any shipped title binds a 3D storage volume this deep. The validation layer isn't installed here, so I make no VUID claims, including for the 2D-array view of the 2049-deep image on the merge-base files.

Setup: Linux, lavapipe Mesa 26.2.4 (LLVM 23.1.1), ctest -V --no-tests=error -R '^agc_driver_graphics$', probe run directly, head dfeb3d8e5a11d7d4bf242eb9ec9e53b64e554635.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6222629521 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6772#issuecomment-6222629521). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-16T18:59:31Z. --- @XairRrR thanks for this. One regression: storage views of 3D volumes deeper than 2048 texels now throw. They worked before this PR. ``` AGC graphics: a storage image with more layers than maxImageArrayLayers that is not a 1D or 2D array is not implemented ``` Cause: `StorageArrayWindow` returns early only when `depthOrLastArray < maxArrayLayers` (core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp:439). For a `k3D` descriptor, `depthOrLastArray` is depth minus one, not a last array slice: `DescribeSurface` makes the image `imageDepth = depthOrLastArray + 1` with `imageLayers = 1`. Vulkan requires `arrayLayers` to be 1 for a 3D image and limits its depth by `maxImageDimension3D` (4096 on lavapipe), not by `maxImageArrayLayers` (2048). A volume 2049 to 4096 deep is therefore a valid image, but it now fails at the next `Require`. `cachedStorageTexture` calls `StorageArrayWindow` for every storage image binding, so by reading this covers any storage use of such a volume, not only the case I ran. The PR description lists "a volume" among the refused cases, and the new unit test checks that rejection (`reject(... volume ..., "not a 1D or 2D array")`), but a volume this deep was not an invalid image. Minimal fix: let volumes pass through unchanged. core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp:439 ```cpp if (viewed.depthOrLastArray < maxArrayLayers || viewed.dimension == TextureDimension::k3D) return viewed; ``` core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp:408 ```cpp Require(StorageArrayWindow(volume, 2048).baseAddress == volume.baseAddress && StorageArrayWindow(volume, 2048).depthOrLastArray == volume.depthOrLastArray, "a volume is not an array"); ``` Repro: I copied tests/execution/ImageStoreArrayThroughVolume.cpp and changed `Depth` from 2 to 2049, with an 8 MiB guest block to hold it. It is the same compute store of a 2D-array view through a linear 3D volume descriptor, and it checks the same 32 stored texels and that the bytes past the volume are unchanged. | tree | deep-volume probe (depth 2049) | agc_driver_graphics | |---|---|---| | PR head dfeb3d8e5 | 3/3 fail, error above | 3/3 pass | | head with ShaderResources.cpp + Texture.cpp taken from the merge base 3f171d03e | 3/3 pass, all 32 texels correct | not run | | head + the two suggestions above | 3/3 pass | 3/3 pass | Everything else checked out: - Your new test passes 3/3 on head and fails 3/3 with the production change reverted and `StorageArrayWindow` stubbed to return its input ("must start at its first viewed slice"). - Merged with main at 16a0f509a, `agc_driver_graphics` passes 3/3. It still merges cleanly (`git merge-tree`) with main at c84249186. - check_conventions.py passes. I did not check whether any shipped title binds a 3D storage volume this deep. The validation layer isn't installed here, so I make no VUID claims, including for the 2D-array view of the 2049-deep image on the merge-base files. Setup: Linux, lavapipe Mesa 26.2.4 (LLVM 23.1.1), `ctest -V --no-tests=error -R '^agc_driver_graphics$'`, probe run directly, head dfeb3d8e5a11d7d4bf242eb9ec9e53b64e554635. AI-assisted: yes
XairRrR commented 2026-10-16 19:45:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-16T19:45:00Z.


@Dextroid17 thanks, you're right: a volume's depthOrLastArray is its depth, bounded by maxImageDimension3D, so a 2049-4096 deep volume was a valid image and must not be refused. Pushed 7d5a75149 with your two suggestions: StorageArrayWindow returns a k3D descriptor unchanged, and the test now checks that a volume deeper than the limit keeps its descriptor (the "not a 1D or 2D array" rejection is tested with a cube instead). The creation guards in Texture/StorageTexture check geometry.imageLayers, which is 1 for a 3D image, so they were not affected.

  • The new volume check fails on the previous head (agc_driver_graphics failed with the early return reverted) and passes with the change.
  • Full ctest on this branch: all pass except agc_driver_store_over_untracked (#5671, fixed by #6385). check_conventions.py passes.
  • PR description updated (volumes are no longer listed as refused).

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6223378636 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6772#issuecomment-6223378636). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-16T19:45:00Z. --- @Dextroid17 thanks, you're right: a volume's `depthOrLastArray` is its depth, bounded by `maxImageDimension3D`, so a 2049-4096 deep volume was a valid image and must not be refused. Pushed 7d5a75149 with your two suggestions: `StorageArrayWindow` returns a `k3D` descriptor unchanged, and the test now checks that a volume deeper than the limit keeps its descriptor (the "not a 1D or 2D array" rejection is tested with a cube instead). The creation guards in `Texture`/`StorageTexture` check `geometry.imageLayers`, which is 1 for a 3D image, so they were not affected. - The new volume check fails on the previous head (`agc_driver_graphics` failed with the early return reverted) and passes with the change. - Full `ctest` on this branch: all pass except `agc_driver_store_over_untracked` (#5671, fixed by #6385). `check_conventions.py` passes. - PR description updated (volumes are no longer listed as refused). AI-assisted: yes
savvaniss commented 2026-10-17 14:43:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-17T14:43:24Z.


Intel and AMD Windows data, from GPUs on both sides of the limit.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest, main 47a266cf9. Intel UHD Graphics 770 (8086:a780, 32-wide subgroups), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550, 64-wide subgroups), driver 32.0.31041.1004, with VkCache emptied first.

Reported maxImageArrayLayers: UHD 770 2048 (as on NVIDIA, so arrays past it take the new path), RX 9070 XT 8192 (the PS5 maximum, so the new path is never needed there).

UHD 770 RX 9070 XT
This head 7d5a75149 merged into main: the 16 tests built from tests/Graphics.cpp and tests/TextureTiling.cpp, ×3 pass pass

There is no without-run: this PR's TextureTiling.cpp test doesn't compile against main.

Full CTest (--parallel 4) with six open PRs merged into main (#6638, #6604, #6014, #6773, #6772, #6725): the same failures as main alone on both GPUs, nothing new. main alone: UHD 770 1392 of 1398, RX 9070 XT 1396 of 1398. The failures are image tables (#6647) and sample_multisample_target (#6971) on Intel, and quad_pixel_mask (#6255) and layered_volume_vertex_no_gpl (#4768) on AMD.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6235240313 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6772#issuecomment-6235240313). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-17T14:43:24Z. --- Intel and AMD Windows data, from GPUs on both sides of the limit. Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, `ANYPS5_NO_SHADER_CACHE=1`, serial CTest, `main` `47a266cf9`. Intel UHD Graphics 770 (`8086:a780`, 32-wide subgroups), driver 32.0.101.7088. AMD Radeon RX 9070 XT (`1002:7550`, 64-wide subgroups), driver 32.0.31041.1004, with `VkCache` emptied first. Reported `maxImageArrayLayers`: UHD 770 2048 (as on NVIDIA, so arrays past it take the new path), RX 9070 XT 8192 (the PS5 maximum, so the new path is never needed there). | | UHD 770 | RX 9070 XT | |---|---|---| | This head `7d5a75149` merged into `main`: the 16 tests built from `tests/Graphics.cpp` and `tests/TextureTiling.cpp`, ×3 | pass | pass | There is no without-run: this PR's `TextureTiling.cpp` test doesn't compile against `main`. Full CTest (`--parallel 4`) with six open PRs merged into `main` (#6638, #6604, #6014, #6773, #6772, #6725): the same failures as `main` alone on both GPUs, nothing new. `main` alone: UHD 770 1392 of 1398, RX 9070 XT 1396 of 1398. The failures are image tables (#6647) and `sample_multisample_target` (#6971) on Intel, and `quad_pixel_mask` (#6255) and `layered_volume_vertex_no_gpl` (#4768) on AMD. AI-assisted: yes (Claude Code)
XairRrR commented 2026-10-17 18:08:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-17T18:08:17Z.


Pushed a95b44a61: sampled views now use the same layer window as storage views (StorageArrayWindow is renamed ArrayLayerWindow).

While testing the earlier head on Uncharted: Legacy of Thieves Collection (PPSA05684), the main menu lost about a third of its frame rate. It samples a 16x16 array of up to ~8000 layers through image-table views of 2689 to 8065 slices. The sampled lookup read and snapshotted the whole surface (~8 MB) before the Texture constructor refused it, about 17 times a frame. Now a view that fits is served from its slices, and one that does not is refused before anything is read. New test: agc_driver_image_array_window_past_layer_limit. Menu fps and the updated test list are in the description.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6238306102 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6772#issuecomment-6238306102). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-17T18:08:17Z. --- Pushed a95b44a61: sampled views now use the same layer window as storage views (`StorageArrayWindow` is renamed `ArrayLayerWindow`). While testing the earlier head on Uncharted: Legacy of Thieves Collection (PPSA05684), the main menu lost about a third of its frame rate. It samples a 16x16 array of up to ~8000 layers through image-table views of 2689 to 8065 slices. The sampled lookup read and snapshotted the whole surface (~8 MB) before the `Texture` constructor refused it, about 17 times a frame. Now a view that fits is served from its slices, and one that does not is refused before anything is read. New test: `agc_driver_image_array_window_past_layer_limit`. Menu fps and the updated test list are in the description. AI-assisted: yes
XairRrR commented 2026-10-19 00:26:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-19T00:26:26Z.


Rebased onto current main and added 04bc0eea5. main's new agc_depth_copy_kept_bytes (from ea02128b5) builds its storage image on mockContext(), which left maxImageArrayLayers at 0. That made this PR's layer check reject the 8x8 image. The mock now reports 2048 layers, as real devices do. All agc_ tests pass except agc_driver_bda_device, which also fails on plain main on this machine. The conventions check passes.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6257064806 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6772#issuecomment-6257064806). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-19T00:26:26Z. --- Rebased onto current `main` and added 04bc0eea5. `main`'s new `agc_depth_copy_kept_bytes` (from ea02128b5) builds its storage image on `mockContext()`, which left `maxImageArrayLayers` at 0. That made this PR's layer check reject the 8x8 image. The mock now reports 2048 layers, as real devices do. All `agc_` tests pass except `agc_driver_bda_device`, which also fails on plain `main` on this machine. The conventions check passes. AI-assisted: yes
XairRrR commented 2026-10-19 21:06:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-19T21:06:31Z.


Rebased onto main 7866e7d97 (f408eb711). #7258 (merged) added ViewedArrayWindow, which narrows a sampled view that starts past slice 0 to its viewed slices when the swizzle allows. This PR's ArrayLayerWindow only acts on arrays past maxImageArrayLayers, and it runs first in cachedTexture and for storage views. The two now sit side by side in TextureTiling.cpp, and both sets of tests are kept. For a sampled view past the limit, the two give the same window. Where they differ, this PR refuses a slice-dependent XOR swizzle rather than keeping the whole array. If you'd rather keep a single function for sampled views, I can drop the sampled call from this PR and leave it to storage views. All 798 agc_ tests pass (Linux, RTX 4070 Ti SUPER), and so does the conventions check.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6277324201 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6772#issuecomment-6277324201). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-19T21:06:31Z. --- Rebased onto `main` 7866e7d97 (f408eb711). #7258 (merged) added `ViewedArrayWindow`, which narrows a sampled view that starts past slice 0 to its viewed slices when the swizzle allows. This PR's `ArrayLayerWindow` only acts on arrays past `maxImageArrayLayers`, and it runs first in `cachedTexture` and for storage views. The two now sit side by side in `TextureTiling.cpp`, and both sets of tests are kept. For a sampled view past the limit, the two give the same window. Where they differ, this PR refuses a slice-dependent XOR swizzle rather than keeping the whole array. If you'd rather keep a single function for sampled views, I can drop the sampled call from this PR and leave it to storage views. All 798 `agc_` tests pass (Linux, RTX 4070 Ti SUPER), and so does the conventions check. AI-assisted: yes
adriadam10 commented 2026-10-20 08:55:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-20T08:55:26Z.


Re-checked after the rebase onto main with #7258: ArrayLayerWindow only acts on arrays past maxImageArrayLayers and sits next to ViewedArrayWindow without overlapping it; both sets of tests are kept and the merge is clean. Merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6287274462 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6772#issuecomment-6287274462). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-20T08:55:26Z. --- Re-checked after the rebase onto `main` with #7258: `ArrayLayerWindow` only acts on arrays past `maxImageArrayLayers` and sits next to `ViewedArrayWindow` without overlapping it; both sets of tests are kept and the merge is clean. Merged.
blawesom commented 2026-10-20 18:44:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-20T18:44:31Z.


agc_driver_image_array_window_past_layer_limit is red on my RADV stack since this merged — first full-suite run after the merge reached main (it came in through the stacked-merge window ending at b85d972f4).

image_sample_lz on a window of a 1D array past maxImageArrayLayers: thread 7 component 0 is 107.000000/255, expected 147/255 — deterministic across reruns, cold GPU (junction 30 °C), and unchanged with the shader cache cleared and with ANYPS5_NO_SHADER_CACHE=1.

AMD RX 9070 XT (RADV GFX1201), Mesa 26.2.4, CachyOS, kernel 7.2.9. @adriadam10's pre-merge recheck above was green — on which stack? If that was a different GPU or Mesa, this may be NAVI4x- or Mesa-version-specific, in the pattern of #7766/#7784 (which pass on AMD's Windows proprietary driver and fail on RADV here).

For transparency on the diagnosis path: the test did not exist on main before the merge (I first misread it as a fresh main regression and ran a bisect; the A/B at the pre-merge anchor exposed the test binary as stale from a later tree, since the target didn't exist at that checkout — so "newly arrived red", not a regression). No open issue mentions it; happy to file one with this data or run any narrower repro.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6298499215 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6772#issuecomment-6298499215). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-20T18:44:31Z. --- **`agc_driver_image_array_window_past_layer_limit` is red on my RADV stack since this merged** — first full-suite run after the merge reached `main` (it came in through the stacked-merge window ending at `b85d972f4`). `image_sample_lz on a window of a 1D array past maxImageArrayLayers: thread 7 component 0 is 107.000000/255, expected 147/255` — deterministic across reruns, cold GPU (junction 30 °C), and unchanged with the shader cache cleared and with `ANYPS5_NO_SHADER_CACHE=1`. AMD RX 9070 XT (RADV GFX1201), Mesa 26.2.4, CachyOS, kernel 7.2.9. @adriadam10's pre-merge recheck above was green — on which stack? If that was a different GPU or Mesa, this may be NAVI4x- or Mesa-version-specific, in the pattern of #7766/#7784 (which pass on AMD's Windows proprietary driver and fail on RADV here). For transparency on the diagnosis path: the test did not exist on `main` before the merge (I first misread it as a fresh main regression and ran a bisect; the A/B at the pre-merge anchor exposed the test binary as stale from a later tree, since the target didn't exist at that checkout — so "newly arrived red", not a regression). No open issue mentions it; happy to file one with this data or run any narrower repro.
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!6772
No description provided.