fix(agc): publish native multisample depth next to a storage image whose pending units lie past its planes #16364
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16364"
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:18Z.
What
A native multisample depth publication (#13021) refuses when storage results are pending over its planes:
native multisample depth publication over pending storage image writes is not implemented.The check asks
StorageTexture::AnyPendingOverlaps, which looks at whole images. So an image that only starts inside a plane refuses the publication even when every unit it still has pending lies past the plane. Nothing pending is then under the planes, and the publication would not overwrite any of it.That case is common, because the depth import already stores the pending units over its planes (
FlushPendingworks per unit). The image is left pending only past them.This change:
StorageTexture::AnyPendingUnitsOverlap. It answers the same question per tracked unit: an image being flushed still counts whole, and a pending image counts only through its units marked pending that overlap the range;The publication debt entry now says "pending storage-image units over a plane".
Tested
Linux 7.2.11, AMD Radeon RX 9070 XT, RADV (Mesa 26.2.6), Release with tests.
agc_driver_native_depth_pending_units(--pending-units), at 2, 4 and 8 samples:kStandard64KB) starts in the last unit of the stencil plane and runs 1.1 MiB past it. Its results are pending (a clear to 0x5a5a5a5a).main5299939ecfwith only the test added (the new query unused): it fails withAGC graphics: native multisample depth publication over pending storage image writes is not implemented.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 origin/main: passes.native multisample depth plane without HTILE does not hold one depth value in [0, 1]: #16363 (overwrite proof), #16365 (single-sample view) 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 (their stops, all later and separate: 452 s and 468 s, or the local VRAM guard at 482 s and 496 s). The import's flush leaves exactly this case: in Mirage the storage image over the planes runs past them.maineaec74e322+ #12898 + #14367 + #9999 + #10497, Linux 7.2.14, same GPU and Mesa. On currentmainthe title also needs #10497: without it the boot stops at 82 s onsample-preserving guest publication of native multisample depth is not implemented for this owner.AGC graphics: native multisample depth publication over pending storage image writes is not implemented(in two of them inside a compute shader dispatch);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:06Z.
Review: COMMENTED
Windows check of head
55817a857a, 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_planesandpublicationaliased_depth_depth_onlymain, nothing newagc_driver_native_depth_pending_unitspasses in every run on both GPUs.pending_unitstook 29.7 s and a skipped test 6.1 s, against under 1 s normally, andaliased_depth_depth_onlypasses in the other runs on both GPUs.maintoo, so this PR adds none. I'm looking into them separately.VK_LAYER_KHRONOS_validation.AI-assisted: yes.