feat(agc): sample with DISABLE_CUBE_WRAP through non-seamless cube samplers #2625

Merged
oneandonlydean merged 1 commit from upstream-pr/2625 into main 2026-10-10 08:47:32 +00:00
oneandonlydean commented 2026-10-10 08:29:29 +00:00 (Migrated from github.com)

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


Carrying @AlxcBTW's fix for #2577 while PR intake is paused. The change is theirs (from AlxcBTW/AnyPS5:fix/agc-non-seamless-cube, ab27ae2c, rebased onto current main; the only conflict was the new opaque-black-border sampler check, kept next to this one).

What

Samplers with DISABLE_CUBE_WRAP (S# word 0 bit 28) are created instead of rejected. When the device supports VK_EXT_non_seamless_cube_map (nonSeamlessCubeMap), the extension is enabled and such samplers get VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT. Without it the sampler is still created, and only a cube texture sampled through it throws (RequireNonSeamlessCube, checked where RequireDegammaFormat is). TechnicalDebt's cube texture entry is updated.

Why

ps5-opengl's Mesa sets DISABLE_CUBE_WRAP on every sampler, because non-seamless cube maps are GL's default, so PPSA99005 stops at its first sampler:

guest sampler descriptor disables seamless cube filtering which is not implemented

RADV sets the same bit exactly when a sampler is created with VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT (Mesa src/amd/vulkan/radv_sampler.c, src/amd/common/ac_descriptors.c). The bit only changes cube filtering.

Tested

  • The author's full CI with the change merged into main c72d5ce1 passes on Linux, macOS and Windows.
  • Windows 11, RTX 5070 Laptop: agc_driver_graphics covers decoding, the create flag with and without the device feature, and the cube-only rejection; ctest -R ^agc 269/269.
  • PPSA99005 with its import fixes gets past the sampler (the chain is in #2026).
  • tools/check_conventions.py passes, and the branch merges cleanly with current main.

Fixes #2577

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4809898085 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2625). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T08:29:29Z. --- Carrying @AlxcBTW's fix for #2577 while PR intake is paused. The change is theirs (from `AlxcBTW/AnyPS5:fix/agc-non-seamless-cube`, ab27ae2c, rebased onto current `main`; the only conflict was the new opaque-black-border sampler check, kept next to this one). ### What Samplers with `DISABLE_CUBE_WRAP` (S# word 0 bit 28) are created instead of rejected. When the device supports `VK_EXT_non_seamless_cube_map` (`nonSeamlessCubeMap`), the extension is enabled and such samplers get `VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT`. Without it the sampler is still created, and only a cube texture sampled through it throws (`RequireNonSeamlessCube`, checked where `RequireDegammaFormat` is). TechnicalDebt's cube texture entry is updated. ### Why ps5-opengl's Mesa sets `DISABLE_CUBE_WRAP` on every sampler, because non-seamless cube maps are GL's default, so PPSA99005 stops at its first sampler: ``` guest sampler descriptor disables seamless cube filtering which is not implemented ``` RADV sets the same bit exactly when a sampler is created with `VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT` (Mesa `src/amd/vulkan/radv_sampler.c`, `src/amd/common/ac_descriptors.c`). The bit only changes cube filtering. ### Tested - The author's full CI with the change merged into `main` c72d5ce1 passes on Linux, macOS and Windows. - Windows 11, RTX 5070 Laptop: `agc_driver_graphics` covers decoding, the create flag with and without the device feature, and the cube-only rejection; `ctest -R ^agc` 269/269. - PPSA99005 with its import fixes gets past the sampler (the chain is in #2026). - `tools/check_conventions.py` passes, and the branch merges cleanly with current `main`. Fixes #2577 ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-10 08:38:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T08:38:21Z.


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
#2169 docs/dev/TechnicalDebt.md L373
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095752349 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2625#issuecomment-6095752349). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T08:38:21Z. --- <!-- 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 | |---|---|---|---| | #2169 | `docs/dev/TechnicalDebt.md` [L373](https://github.com/boykopovar/AnyPS5/blob/8f442a7554c79fff2252061171dbe259a1c8842e/docs/dev/TechnicalDebt.md#L373) | | |
adriadam10 commented 2026-10-10 08:47:29 +00:00 (Migrated from github.com)

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


Checked on the PR merged onto current main: libSceAgcDriver build and ctest (314/314), and agc_driver_graphics fails to build without the change (it uses nonSeamlessCube / nonSeamlessCubeMap). Also measured the bit on gfx1035 (64x64 R32_FLOAT cube, bilinear, samples 0.002 from a face edge, all six faces): with DISABLE_CUBE_WRAP clear the result blends the neighbouring face, with it set the result is the face's own value, which is what VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT does. Without the device feature the sampler is created and only a cube texture sampled through it throws, as the TechnicalDebt entry says. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095820037 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2625#issuecomment-6095820037). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T08:47:29Z. --- Checked on the PR merged onto current `main`: libSceAgcDriver build and ctest (314/314), and `agc_driver_graphics` fails to build without the change (it uses `nonSeamlessCube` / `nonSeamlessCubeMap`). Also measured the bit on gfx1035 (64x64 R32_FLOAT cube, bilinear, samples 0.002 from a face edge, all six faces): with `DISABLE_CUBE_WRAP` clear the result blends the neighbouring face, with it set the result is the face's own value, which is what `VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT` does. Without the device feature the sampler is created and only a cube texture sampled through it throws, as the TechnicalDebt entry says. Merging once CI is green.
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!2625
No description provided.