fix(agc): restrict lazy sampled view usage #7116

Merged
Sam-mon7 merged 1 commit from upstream-pr/7116 into main 2026-10-17 21:17:22 +00:00
Sam-mon7 commented 2026-10-17 12:12:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Sam-mon7 on 2026-10-17T12:12:46Z.


What

Texture::BaseLevelView() creates its view lazily from baseLevelInfo, so the view inherits every usage of the image it views. For a sampled sRGB view of a storage image, that includes STORAGE, which the sRGB format does not support: VUID-VkImageViewCreateInfo-usage-02275.

  • Fix: the lazy base-level view now restricts its usage to SAMPLED, as SrgbView already does.
  • Relation to #862: #862 fixes the same error for the views the constructor creates. This is the remaining path, and neither change depends on the other.
  • New test agc_sampled_storage_base_level_usage: samples a two-mip sRGB view of a storage image. The base-level view must carry VkImageViewUsageCreateInfo with SAMPLED, read the correct sRGB-decoded value and be reused.

Tested

  • Setup: Windows 11, MinGW GCC 15.2 (WinLibs), RTX 4070, on main bf2053816.
  • Negative control: without the fix, the new test fails at vkCreateImageView base level (the test rejects the unrestricted view). With the fix, it passes.
  • Validation layer: under VK_LAYER_KHRONOS_validation 1.4.363, the new test reports two 02275 errors with this change alone, both from the constructor's views (#862's path). With #862 applied too, it reports none.
  • Tests: all 55 tests in agc_driver_recorder_tests and agc_driver_graphics_tests pass. Full suite: 1,375 of 1,377 pass. The two failures, agc_driver_f16_fma_denormal_modes and agc_driver_fma_mix_f16_denormal_modes (f16 NaN encodings), fail the same way on main on this GPU and driver. After rebasing onto c9e6c45de, the new test and the 55 tests above pass again.
  • Title: found on Demon's Souls (PPSA01341, #1283). On an integration branch with #862 and this change (main 3ebad9045 plus open PRs), the Nexus route under validation no longer reports 02275.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4070, driver 610.88, Windows 11
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4899948155 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7116). Originally posted by [Sam-mon7](https://github.com/Sam-mon7) on 2026-10-17T12:12:46Z. --- ### What `Texture::BaseLevelView()` creates its view lazily from `baseLevelInfo`, so the view inherits every usage of the image it views. For a sampled sRGB view of a storage image, that includes `STORAGE`, which the sRGB format does not support: `VUID-VkImageViewCreateInfo-usage-02275`. - **Fix:** the lazy base-level view now restricts its usage to `SAMPLED`, as `SrgbView` already does. - **Relation to #862:** #862 fixes the same error for the views the constructor creates. This is the remaining path, and neither change depends on the other. - **New test `agc_sampled_storage_base_level_usage`:** samples a two-mip sRGB view of a storage image. The base-level view must carry `VkImageViewUsageCreateInfo` with `SAMPLED`, read the correct sRGB-decoded value and be reused. ### Tested - **Setup:** Windows 11, MinGW GCC 15.2 (WinLibs), RTX 4070, on `main` `bf2053816`. - **Negative control:** without the fix, the new test fails at `vkCreateImageView base level` (the test rejects the unrestricted view). With the fix, it passes. - **Validation layer:** under `VK_LAYER_KHRONOS_validation` 1.4.363, the new test reports two 02275 errors with this change alone, both from the constructor's views (#862's path). With #862 applied too, it reports none. - **Tests:** all 55 tests in `agc_driver_recorder_tests` and `agc_driver_graphics_tests` pass. Full suite: 1,375 of 1,377 pass. The two failures, `agc_driver_f16_fma_denormal_modes` and `agc_driver_fma_mix_f16_denormal_modes` (f16 NaN encodings), fail the same way on `main` on this GPU and driver. After rebasing onto `c9e6c45de`, the new test and the 55 tests above pass again. - **Title:** found on Demon's Souls (PPSA01341, #1283). On an integration branch with #862 and this change (main `3ebad9045` plus open PRs), the Nexus route under validation no longer reports 02275. ### 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 - [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: none - [x] GPUs tested: NVIDIA GeForce RTX 4070, driver 610.88, Windows 11 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-17 12:42:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T12:42:49Z.


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 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4339 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5958 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6130 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6176 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6222 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6234 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6259 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6320 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6373 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6414 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6553 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6601 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6887 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6959 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6965 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6973 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6987 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6989 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6995 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7002 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7207 core/libs/prx/libSceAgcDriver/CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234012352 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7116#issuecomment-6234012352). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T12:42:49Z. --- <!-- pr-overlap --> 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 1341](https://www.github.com/boykopovar/AnyPS5/pull/1341) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4339](https://www.github.com/boykopovar/AnyPS5/pull/4339) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 4650](https://www.github.com/boykopovar/AnyPS5/pull/4650) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 5371](https://www.github.com/boykopovar/AnyPS5/pull/5371) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5426](https://www.github.com/boykopovar/AnyPS5/pull/5426) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [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/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 5958](https://www.github.com/boykopovar/AnyPS5/pull/5958) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6130](https://www.github.com/boykopovar/AnyPS5/pull/6130) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6176](https://www.github.com/boykopovar/AnyPS5/pull/6176) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6197](https://www.github.com/boykopovar/AnyPS5/pull/6197) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6222](https://www.github.com/boykopovar/AnyPS5/pull/6222) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6234](https://www.github.com/boykopovar/AnyPS5/pull/6234) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6259](https://www.github.com/boykopovar/AnyPS5/pull/6259) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6320](https://www.github.com/boykopovar/AnyPS5/pull/6320) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6373](https://www.github.com/boykopovar/AnyPS5/pull/6373) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6414](https://www.github.com/boykopovar/AnyPS5/pull/6414) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6535](https://www.github.com/boykopovar/AnyPS5/pull/6535) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6539](https://www.github.com/boykopovar/AnyPS5/pull/6539) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6553](https://www.github.com/boykopovar/AnyPS5/pull/6553) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6601](https://www.github.com/boykopovar/AnyPS5/pull/6601) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6718](https://www.github.com/boykopovar/AnyPS5/pull/6718) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6747](https://www.github.com/boykopovar/AnyPS5/pull/6747) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6887](https://www.github.com/boykopovar/AnyPS5/pull/6887) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6959](https://www.github.com/boykopovar/AnyPS5/pull/6959) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6965](https://www.github.com/boykopovar/AnyPS5/pull/6965) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6973](https://www.github.com/boykopovar/AnyPS5/pull/6973) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6987](https://www.github.com/boykopovar/AnyPS5/pull/6987) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6989](https://www.github.com/boykopovar/AnyPS5/pull/6989) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6995](https://www.github.com/boykopovar/AnyPS5/pull/6995) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7002](https://www.github.com/boykopovar/AnyPS5/pull/7002) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7207](https://www.github.com/boykopovar/AnyPS5/pull/7207) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` |
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!7116
No description provided.