fix(agc): attach a smaller native multisample depth extent with the same Z_X layout to its owner #15690
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15690"
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-04T06:29:27Z.
What
Assassin's Creed Mirage (PPSA13960) uses dynamic resolution on a 4-sample D32S8 depth target without HTILE. It draws the planes at 1920x1080, a guest access publishes them (#15688), and the next frame binds the same depth and stencil addresses with every field equal except the extent, 1872x1056. A new owner over the planes of a host-written owner is refused, so the title stops with
a native multisample depth attachment over the planes of a host-written owner of another identity is not implemented.On the console both extents address the same memory. For 4-sample Z_X, a 64 KiB block is 64x64 pixels for 32-bit depth and 128x128 for the 8-bit stencil plane. 1872x1056 and 1920x1080 pad to the same pitch and padded height on both planes (30x17 and 15x9 blocks), so every pixel of the smaller extent has the address it has in the larger one.
A multisampled depth target without HTILE is now drawn into a resident owner when:
MultisampleTextureLayout, are the owner's.The owner keeps its image and samples. The draw's framebuffer is the render extent, which may be smaller than the attachment. The same rule applies where a draw notes its depth write and where the sample-order and sample-location paths look up the owner. Those paths take the owner's extent for the reorder, since the whole image is in host order.
Still refused, as before:
native multisample depth sampled identity or format mismatch).Tested
Linux 7.2.11, AMD Radeon RX 9070 XT, RADV (Mesa 26.2.6), Release with tests.
agc_driver_native_depth_smaller_extent(--smaller-extent), at 2, 4 and 8 samples:8cc85b8cb1. The fetch runs one workgroup per sample, so at 4 and 8 samples it dispatched 104000 and 208000 groups, past the 65536maxComputeWorkGroupCount[0]of an Intel iGPU (found in review). The new sizes keep the same pitch and padded height on both planes at 2, 4 and 8 samples, still span more than one block in each axis, and dispatch at most 55744 groups.a native multisample depth attachment over the planes of a host-written owner of another identity is not implemented.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1), the 21agc_driver_native_multisample_depth/agc_driver_native_depth_*tests, on8cc85b8cb1(#15688's head79a72e5259merged): withDepthSurface.cppfrom #15688 and the new test, 20 of 21, the new test failing as above; with this change, 21 of 21. Neither log has aVUID-line or "was not found but was requested". The same pair on #15688's earlier head288fc4e584gave 15 of 16 and 16 of 16.tools/check_conventions.py: passes.main1c8c0efc8c+ #13963 (fc1dfc03ab, needed for an earlier stop) + #15688:depth 0x1249300000 stencil 0x124b2e0000 htile 0 1872x1056over the published 1920x1080 owner of the same addresses, every other field equal.native multisample depth publication over pending storage image writes is not implemented. That is a separate stop.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 Superseabas on 2026-11-04T17:09:51Z.
Review: APPROVED
Head
6c1c4ef23fmerged onto currentmainb11c7bf84f(clean merge, local only): code read, red/green check and a run on AMD's Windows driver, which no run of this stack has covered yet, with an NVIDIA Blackwell run alongside.Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (
x86_64-ucrt-posix-seh, r3), Release,BUILD_TESTING=ON.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ctest -R '^agc_driver_native_(depth|multisample_depth).*$',ANYPS5_GPUselecting the device (confirmed bySelected GPU). In each tree one test,agc_driver_native_depth_driver_queued_fill, skips on Windows as onmain:main10de:2c05)1002:164e)VUID-lines and no missing-layer line in any run.DepthSurface.cppchange reversed (git diffof #15688's headfa590e435aagainst this head, applied in reverse) fails the newagc_driver_native_depth_smaller_extenton both GPUs. It fails witha native multisample depth attachment over the planes of a host-written owner of another identity is not implemented, the stop the description names.check_conventions.py --base mainpasses on the merge.Read through the change:
sameLayoutWithinaccepts only a multisampled owner without HTILE and withdepthSwizzle24 that is at least as wide and tall as the target. The target, resized to the owner's extent, must besameSurface. For the depth plane and for the stencil (or the depth width again when there is no separate stencil), the Z_64KB_X layout must give the same pitch, padded height and byte size at both extents, so the smaller target addresses the same bytes as the owner.holdsTargetreplacessameSurfacein the write notice, the sample-order and sample-location lookups and the feedback check. The view lookup only falls back to asameLayoutWithinowner when no surface matched.DepthSurfaceOrderTargetnow returns the owner's extent, which matches the image it hands out.I found nothing to change.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T12:41:16Z.
Review: COMMENTED
Ran
75d55bd6f1merged onmain302864d48con Windows 11 x64 (WinLibs GCC 15.2), on an NVIDIA laptop GPU (Turing, driver 621) and an Intel iGPU (driver 101.70xx), withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(Khronos validation layer 1.4.368),ctest -R '^agc_driver_native_(multisample_depth|depth_)' -V.mainVUID-VUID-VUID-On Intel the new
agc_driver_native_depth_smaller_extentdispatches past the device limit. It reports "Passed", but each run logs this once with 104000 and once with 208000, right after itssamples=2andsamples=4cases:#15688 (the branch under this one) has no validation error in the same tests on the same GPU, so the dispatch comes in with this PR's smaller-extent path. NVIDIA's limit is far higher, so the layer stays quiet there. A dispatch over the limit is undefined behaviour, so this isn't a pass on Intel. The X count needs splitting into chunks of at most
maxComputeWorkGroupCount[0], or spreading over Y.The four Intel failures are #15688's
publication_without_htileplus the three that fail onmaintoo (#16883). The layer was inserted in every test, and no log haswas not found but was requested by env var VK_INSTANCE_LAYERS. #15707, which builds on this branch, shows the same two errors.AI-assisted: yes.