fix(agc): leave a single-sample view over a published native multisample depth owner to guest memory #16365
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16365"
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-11-06T12:04:21Z.
What
A title can read the memory of a native multisample D32S8 target without HTILE through a single-sample view at the depth base. Assassin's Creed Mirage (PPSA13960) does: a compute reads mip 0 of an R11G11B10F chain it wrote over the planes, at the depth address (
resource 0x10f5d40000 3440x1936 x1 fmt 36against the owner1720x968 x4).DepthSurfaceTexturetakes every view at the base of an owner into the native path, and a single-sample view fails its identity check there:native multisample depth sampled identity or format mismatch.For an owner the host has not written since its import or its last publication (#15688), guest memory already holds every sample. The import only accepts planes that each hold one value, and a publication writes all samples back to the planes.
This change:
DepthSurface::GuestHoldsSamples: a multisampled owner without HTILE, imported for sampling, with no refusal, not written by the host since its import or publication;Tested
Linux 7.2.11, AMD Radeon RX 9070 XT, RADV (Mesa 26.2.6), Release with tests.
agc_driver_native_depth_single_sample_view(--single-sample-view), at 2, 4 and 8 samples, on a 200x130 D32S8 target without HTILE whose planes hold 1.0 and 0x5a. A single-sample R11G11B10F view (400x260,kStandard64KB) at the depth base:fa590e435a) with only the test added: the first view throwsAGC graphics: native multisample depth sampled identity or format mismatch.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1,ctest -V -R "native_depth|native_multisample|depth_storage|depth_surface|agc_storage_|multisample_guest|repeat_storage_guard|cached_image|storage_flush_ordering|storage_one_slice|storage_read_during|storage_write_back|msaa_address_on_plane", 55 tests):VUID-line or "was not found but was requested". Both have the same 20WARNING-VkImageSubresourceRange-layerCount-compatibilitylines.tools/check_conventions.py --base fa590e435a: passes.compute shader 0x10b4c8ad00: AGC graphics: native multisample depth sampled identity or format mismatch(the read above). This change is one of four that move the title pastnative multisample depth plane without HTILE does not hold one depth value in [0, 1]: #16363 (overwrite proof), #16364 (pending units) and #15941 (or a change that starts a new owner under pending storage results). Its effect shows only together with the others, so the runs are in #16363. In short, onmain5299939ecf+ #13963 (7d548223bd) + #15707 (a8c5df4e69), the run without the changes stopped at 484 s on that message, and none of the four runs with them stopped on it or on the identity mismatch (their stops, all later and separate: 452 s and 468 s, or the local VRAM guard at 482 s and 496 s).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-07T17:40:05Z.
Review: COMMENTED
Windows check of head
4b409e76e8, merged ontomain4e44ed59b2(clean merge), withmainfrom the same build directory as the control.Setup: Windows 11 x64, WinLibs GCC 15.2.0 r7, Release, full build.
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest -R '^agc_driver_native_depth_', 3 runs per GPU on each side.mainstencil_view,uniform_planesandpublicationnative_depth_stencilpublication_without_htile, 3 of 3agc_driver_native_depth_single_sample_viewpasses in every run on both GPUs.aliased_depth_depth_only24 s, against under 1 s normally, andnative_depth_stencilpasses in the other runs on both GPUs.publication_without_htilecomes with the #15688 commits this branch merges. On the Intel iGPU it fails witha written D32S8 owner without HTILE did not publish its stencil samples and padding, the same D32S8 stencil pattern as the three tests that already fail onmainthere, and it passes on the NVIDIA GPU. I'm looking into that separately; it doesn't block this PR.VK_LAYER_KHRONOS_validation.AI-assisted: yes.