Skip to content

fix(agc): give block-copied textures an sRGB view - #8159

Closed
savvaniss wants to merge 1 commit into
boykopovar:mainfrom
savvaniss:fix/agc-block-copy-srgb-view
Closed

savvaniss wants to merge 1 commit into
boykopovar:mainfrom
savvaniss:fix/agc-block-copy-srgb-view

Conversation

@savvaniss

Copy link
Copy Markdown
Contributor

What

A texture that is copied block for block from a storage image (Texture::BlockCopyTag) never got an sRGB view. Sampling one through an S# with FORCE_DEGAMMA therefore stopped with "a texture of guest format N, which is not sRGB and has no sRGB view, is sampled through a sampler that forces sRGB decoding". Textures read from guest memory and views of a storage image already have one.

The block-copy image is now created with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT when its format has an sRGB twin (SrgbTwinFormat). It then prepares its sRGB view like the other two constructors do. A format without a twin is unchanged and still throws.

On main this affects BC textures read while their blocks are still pending in a 32x2 or 32x4 uint storage image. The PS4 path of #6977 also block-copies a smaller GCN view of a render target. Trivial Pursuit Live! (CUSA03312) samples such an 8_8_8_8_UNORM view with FORCE_DEGAMMA before its language menu.

Tested

Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release.

  • agc_driver_bc_block_copy gains a case for BC7 and BC1: the pending blocks are sampled through FORCE_DEGAMMA and must match, bit for bit, the same blocks sampled after they are stored. The stored sample must also differ from a sample without the bit. On main's Texture.cpp the new case fails with the error above; with the change it passes.
  • agc_driver_bc_block_copy and agc_driver_image_sample_force_degamma ran on main and on this branch with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (ctest -R ... -V), on both GPUs below. Both pass in all four runs. No log contains was not found but was requested by env var VK_INSTANCE_LAYERS, and none contains a VUID- line.
  • Trivial Pursuit Live! (CUSA03312): with this change on top of feat: run PS4 games on the AGC driver — Limbo (CUSA01664) in game (integration branch) #6977, the title reaches its language menu and title screen at 60 fps on the RX 9070 XT. Without it, it stops at the error above.
  • tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py lists many open PRs that touch Texture.cpp. Of those, only fix(agc): reclaim idle images safely during cache creation #7800 changes the block-copy constructor, and only its memory allocation.

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: CUSA03312 Hasbro Family Fun Pack (CUSA03312) #7198 (Trivial Pursuit Live!, on the PS4 path of feat: run PS4 games on the AGC driver — Limbo (CUSA01664) in game (integration branch) #6977)
  • GPUs tested: AMD Radeon RX 9070 XT (driver 32.0.31041.1004) and Intel UHD Graphics 770 (driver 32.0.101.7088), Windows 11 Pro 26300
  • AI-assisted: yes

🤖 Generated with Claude Code

A texture copied block for block from a storage image had no sRGB view,
so sampling it through an S# with FORCE_DEGAMMA threw. Its image is now
created mutable when its format has an sRGB twin, and the view is
prepared as for the other textures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

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
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6187 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6209 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6249 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6280 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6682 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6683 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6718 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6820 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6946 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6947 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6960 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6971 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6977 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/src/Texture.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7332 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7514 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7604 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp

@github-actions github-actions Bot added the agc libSceAgc* label Oct 20, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 20, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Thanks for this. #7799 makes the same change (the sRGB view for block-copied textures, with the same test) and is a day older, so we'll carry it there. Your test results would be very useful on #7799, please add them there. Closing this one as a duplicate.

@savvaniss

Copy link
Copy Markdown
Contributor Author

@oneandonlydean thanks, agreed. I posted the results on #7799, rerun on its current head: #7799 (comment)

AI-assisted: yes (Claude Code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants