Skip to content

fix(agc): sample a multisampled 11_11_10 float texture in its sampled format - #11691

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
hugodearaujo:fix/agc-msaa-format36-sampled
Oct 28, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
hugodearaujo:fix/agc-msaa-format36-sampled

Conversation

@hugodearaujo

Copy link
Copy Markdown
Contributor

What

Since #8898, ResolveTextureFormat gives format 36 (11_11_10_FLOAT) its storage form, R32_UINT, which the shader packs and unpacks. A sampled format 36 image is still read through its native B10G11R11_UFLOAT view (SampledTextureFormat, and nativeRepacked in ResourceMaterializer). MultisampleTargetTexture and MultisampleTargetFirstSample kept matching the resident multisampled target by ResolveTextureFormat, so a 4x COLOR_10_11_11 float target, which DecodeColorBuffer renders as B10G11R11_UFLOAT (the same bits as format 36), is refused when it is read through a format 36 texture descriptor of the same shape:

compute shader 0x10b4e03d00: AGC graphics: sampling multisampled color target 0x10e0720000 (960x540, 4 samples, vk format 122) as a 960x540 texture of 4 samples and guest format 36 (vk 98) is not implemented

Assassin's Creed Mirage (PPSA13960) stops on this line 86 to 91 s after start on main.

Both functions now match and fill a multisampled texture in SampledTextureFormat. The repacked format 43 keeps ResolveTextureFormat, as before: its sampled view needs repacked words, which the multisampled path does not produce. For every other format the two give the same Vulkan format, except the 8 and 8_8 sRGB formats on a device that cannot sample them, which were refused before and still are.

agc_driver_sample_multisample_target gains a case that draws a 4x COLOR_10_11_11 float target (0.25, 0.5, 0.125) and reads every sample through format 36 Dim2DMsaa and Dim2DMsaaArray descriptors, and sample 0 through DIM 2D image_load, image_sample_lz and image_sample_l.

Tested

Linux 7.2.11, GCC 16.2.1, Ninja, Release, AMD Radeon RX 9070 XT (RADV, Mesa 26.2.5). The tests ran on main abed035 and this branch on top of it; MultisampleTarget.cpp and the test file are the same on main a120df3, where the title runs below were made.

  • ctest -V -R '^agc_driver_sample_multisample_target$' with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1:
result VUID- lines validation layer inserted
main passed 0 yes
main + the new case only failed: AGC graphics: sampling multisampled color target 0x55eec24a0000 (16x16, 4 samples, vk format 122) as a 16x16 texture of 4 samples and guest format 36 (vk 98) is not implemented 0 yes
this branch passed 0 yes

No run printed was not found but was requested by env var VK_INSTANCE_LAYERS.

  • The same settings over 34 multisample, FMASK and converted-format tests (agc_driver_msaa_layout, agc_driver_msaa_dcc_clear_{2,4,8}, agc_driver_msaa_dcc_compared_import_{2,4,8}, agc_driver_multisample_* including the readback variants, agc_driver_native_fmask, agc_driver_native_msaa_vertex_input, agc_driver_native_multisample_depth, agc_driver_fmask_image_reads, agc_driver_cached_image_multisample_guard, agc_driver_image_msaa_address_on_plane, agc_driver_msaa_enable_single_sample, agc_driver_multisampled_pass_order, agc_driver_packed_unorm4444_multisample_partial_write, agc_driver_sample_mask_multisample, agc_driver_sample_multisample_target, agc_driver_image_converted_unorm, agc_driver_image_repacked_float, image_msaa_load): 34 of 34 pass on main and on this branch, 0 VUID- lines in both; the loader inserted the layer in the 32 tests that open a Vulkan device (agc_driver_msaa_layout and image_msaa_load don't).

  • Assassin's Creed Mirage (PPSA13960), main a120df3 and main + this change, otherwise the same build, Cross every 30 s: main stops at 87 s on the line above. With this change that line is gone, and the title stops at 83 s on the next refusal: presenting reads the 0x1fe0000-byte surface at 0x10dfd20000, which overlaps the same 4x target:

    AGC graphics: a CPU read of 0x10dfd20000+0x1fe0000 overlaps multisampled color target 0x10e0720000+0x870000 (4 samples), whose samples are only on the host: guest access to it is not implemented
    

    That is the overlap fix(agc): retire a multisampled color target the title wrote over #8223 and fix(agc): retire a multisampled color target a write-only storage image overwrites #10049 work on. With fix(agc): retire a multisampled color target the title wrote over #8223 (head 331399d) merged on top, that read passes too, and the title stops at 87 s on the partial clear described in fix(agc): retire a multisampled color target the title wrote over #8223's thread: compute shader 0x1000810a00: AGC graphics: a cached image access of 0x10dc1d0000+0x480000 overlaps multisampled color target 0x10dc450000+0x480000 (4 samples), whose samples are only on the host: guest access to it is not implemented. Two other runs with this change (one of them with fix(agc): retire a multisampled color target the title wrote over #8223 merged too) segfaulted on the main thread 3 s after start, before any GPU work: the start-up crash fix(linux): enter the guest entry on a main stack at the console's address #7532 addresses.

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 their library's technical debt file
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none (regression from fix(shader_recompiler): pack format 11_11_10 float image stores in shader #8898)
  • Unblocks: PPSA13960 Assassin's Creed Mirage (PPSA13960) #7534 (Assassin's Creed Mirage), the stop above
  • GPUs tested: AMD Radeon RX 9070 XT (RADV, Mesa 26.2.5)
  • AI-assisted: yes

… format

Since boykopovar#8898 ResolveTextureFormat gives format 36 (11_11_10 float) its storage form R32_UINT, while a sampled
format 36 image is read through its native B10G11R11_UFLOAT view (SampledTextureFormat). MultisampleTargetTexture
and MultisampleTargetFirstSample still matched the resident target by ResolveTextureFormat, so a 10_11_11 float
color target (B10G11R11_UFLOAT) sampled as a format 36 texture of the same shape was refused.
@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 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 6808 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 6971 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
PR 8223 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 9533 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
PR 9700 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
PR 9717 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
PR 9742 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
PR 10049 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
PR 10233 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 11920 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp

@hugodearaujo

Copy link
Copy Markdown
Contributor Author

I checked the six PRs the overlap comment could not compare against this branch. #8223, #10049, #10194 and #10233 merge with it without conflicts in MultisampleTarget.cpp and SampleMultisampleTarget.cpp. #6808 and #6971 conflict in MultisampleTarget.cpp with code current main changed after they were written (collectBlocks/fmaskSnapshotResource, absorbDccFill, OrderView), not with the lines this PR changes; neither changes the format MultisampleTargetTexture and MultisampleTargetFirstSample match against (#6971 adds the viewType parameter main already has). The title run with #8223 merged on top is in Tested.

@jotitadev jotitadev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux run on NVIDIA and lavapipe, since the description covers RADV only. Head f4274307ec on main b986c11a34 (patch applies cleanly). Ubuntu 26.04, GCC 15.2, Release. ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, -j1. lavapipe selected with VK_ICD_FILENAMES=.../lvp_icd.json.

agc_driver_sample_multisample_target:

RTX 3070 (NVIDIA 595.99.02) lavapipe (Mesa 26.0.3)
main + the new case only fails: sampling multisampled color target ... (16x16, 4 samples, vk format 122) as a 16x16 texture of 4 samples and guest format 36 (vk 98) is not implemented same failure
this head passes passes

Full ^agc suite (without agc_display_buffer_dcc, agc_driver_flip, agc_driver_lds_atomics64, --timeout 30) with #11692 and #11691 applied together on main: 1041/1042 on both devices. The one failure on each also fails on unmodified main on this machine, with the same message: agc_driver_pipeline_journal on the 3070 (the oversized record was not counted as a write failure; it passes when only the NVIDIA ICD is visible), and agc_driver_multisample_retirement on lavapipe (MSAA storage promotion did not retain its source image).

GPUs tested: NVIDIA GeForce RTX 3070 (proprietary 595.99.02, Linux), lavapipe (Mesa 26.0.3, LLVM 21).

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head f4274307ecd56b995e43983780601bf6f70f2670; approve.

The format selection is consistent with the resource materializer: non-repacked descriptors use SampledTextureFormat, including format 36's native B10G11R11_UFLOAT view, while repacked formats retain ResolveTextureFormat. Both target matching paths (multisample sampling and first-sample reads) use the same selection. The regression covers 4x COLOR_10_11_11 rendered storage read through format 36 using both Dim2DMsaa and Dim2DMsaaArray, plus sample-0 image load/sample operations. I found no conflicting change to these comparisons in the manually checked overlap cases.

Validation evidence: the author reports the focused main/new-case/change comparison and 34 related MSAA tests on RADV with Khronos validation and zero VUIDs. An independent reviewer reports the focused failing-main/passing-change reproduction and an AGC suite run on both RTX 3070 and lavapipe; the sole suite failures also reproduce on unchanged main. Hosted product jobs are skipped by path policy. I could not run a fresh local GPU test here because this environment exposes no GPU device.

@adriadam10 adriadam10 self-assigned this Oct 27, 2026
@github-actions github-actions Bot added the agc libSceAgc* label Oct 27, 2026
@maskym

maskym commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Windows + NVIDIA result for head f4274307ec, merged into main f759e165d9 (the PR's GPUs tested line names no NVIDIA run on Windows).

This PR's own tests: agc_driver_sample_multisample_target (1.18 s), all passed.

Host: Windows 11 26300, Intel i7-12700K, NVIDIA GeForce RTX 2070 SUPER (vendor 0x10de, device 0x1e84; Vulkan loader 1.4.357 from the NVIDIA driver), Khronos Validation Layers nightly 1.4.366 (b2b44c0d37) through VK_ADD_LAYER_PATH, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja. Build clean.

Same focused run on main f759e165d9 and on this tree, same machine and GPU: 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 -R '^(agc|guest_video_out|video_out)' --parallel 4 -V.

The tree also carried the open PRs #11951, #11711, #11704, #11692, #11690, #11794, #11949, all merged cleanly, so the run is a joint one; of those, #11692's new agc_driver_depth_plane_cpu_write_after_page_unwatch fails on this host, reported on that PR. Not run on a PS5.

AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine.

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the format selection against SampledTextureFormat/ResolveTextureFormat in TextureFormat.cpp: format 36 resolves to its native B10G11R11_UFLOAT view for sampling, repacked format 43 keeps ResolveTextureFormat, so both multisample paths now match the materializer. The new case reads the 4x COLOR_10_11_11 target through format 36 (Dim2DMsaa, Dim2DMsaaArray, sample 0) and fails without the change, as shown by the author on RADV and by @jotitadev on NVIDIA and lavapipe; merged.

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.

5 participants