fix(agc): sample a multisampled 11_11_10 float texture in its sampled format #11691
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11691"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-27T02:59:09Z.
What
Since #8898,
ResolveTextureFormatgives 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 nativeB10G11R11_UFLOATview (SampledTextureFormat, andnativeRepackedinResourceMaterializer).MultisampleTargetTextureandMultisampleTargetFirstSamplekept matching the resident multisampled target byResolveTextureFormat, so a 4xCOLOR_10_11_11float target, whichDecodeColorBufferrenders asB10G11R11_UFLOAT(the same bits as format 36), is refused when it is read through a format 36 texture descriptor of the same shape: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 keepsResolveTextureFormat, 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_targetgains a case that draws a 4xCOLOR_10_11_11float target (0.25, 0.5, 0.125) and reads every sample through format 36Dim2DMsaaandDim2DMsaaArraydescriptors, and sample 0 throughDIM 2Dimage_load,image_sample_lzandimage_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
mainabed035468and this branch on top of it;MultisampleTarget.cppand the test file are the same onmaina120df3486, where the title runs below were made.ctest -V -R '^agc_driver_sample_multisample_target$'withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1:VUID-linesmainmain+ the new case onlyAGC 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 implementedNo 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 onmainand on this branch, 0VUID-lines in both; the loader inserted the layer in the 32 tests that open a Vulkan device (agc_driver_msaa_layoutandimage_msaa_loaddon't).Assassin's Creed Mirage (PPSA13960),
maina120df3486andmain+ this change, otherwise the same build, Cross every 30 s:mainstops 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:That is the overlap #8223 and #10049 work on. With #8223 (head
331399d903) merged on top, that read passes too, and the title stops at 87 s on the partial clear described in #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 #8223 merged too) segfaulted on the main thread 3 s after start, before any GPU work: the start-up crash #7532 addresses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in their library's technical debt file.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T05:08:45Z.
Review: COMMENTED
Linux run on NVIDIA and lavapipe, since the description covers RADV only. Head
f4274307econmainb986c11a34(patch applies cleanly). Ubuntu 26.04, GCC 15.2, Release.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1,-j1. lavapipe selected withVK_ICD_FILENAMES=.../lvp_icd.json.agc_driver_sample_multisample_target:main+ the new case onlysampling multisampled color target ... (16x16, 4 samples, vk format 122) as a 16x16 texture of 4 samples and guest format 36 (vk 98) is not implementedFull
^agcsuite (withoutagc_display_buffer_dcc,agc_driver_flip,agc_driver_lds_atomics64,--timeout 30) with #11692 and #11691 applied together onmain: 1041/1042 on both devices. The one failure on each also fails on unmodifiedmainon this machine, with the same message:agc_driver_pipeline_journalon the 3070 (the oversized record was not counted as a write failure; it passes when only the NVIDIA ICD is visible), andagc_driver_multisample_retirementon 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.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T05:27:53Z.
Review: APPROVED
Reviewed exact head
f4274307ecd56b995e43983780601bf6f70f2670; approve.The format selection is consistent with the resource materializer: non-repacked descriptors use
SampledTextureFormat, including format 36's nativeB10G11R11_UFLOATview, while repacked formats retainResolveTextureFormat. Both target matching paths (multisample sampling and first-sample reads) use the same selection. The regression covers 4xCOLOR_10_11_11rendered storage read through format 36 using bothDim2DMsaaandDim2DMsaaArray, 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.