fix(agc): allocate the sampled depth shadow through the image allocator #15855
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15855"
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 BunnyFl on 2026-11-04T19:57:15Z.
What
mainat0263899e99doesn't compilelibSceAgcDriver:#15301 (merged 19:20 UTC today) moved the sampled depth shadow in
createSampleShadowontoOwnedImage::Allocate(context, VkMemoryAllocateInfo, mask, operation). Its branch is based on9090972b7e, which predates #10472 (9c6391d5a1, merged 04:48 UTC today). #10472 replaced that overload withAllocate(const Context&, const VkImageCreateInfo&, const char* operation, bool newImage = false, bool budgeted = false)(Texture.hpp:54onmain). Reported on #15301 in issuecomment-6640160657.This PR moves the call to the form #10472 gave every other
OwnedImagecaller: pass the image'sVkImageCreateInfoand bind atowned->allocation.Memory()andowned->allocation.Offset(), the same as the depth plane copy atDepthSurface.cpp:1917onmain. TheVkMemoryRequirements/VkMemoryAllocateInfolocals that only fed the old overload are removed. The allocator reads the requirements itself withvkGetImageMemoryRequirements2(core/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp:749onmain).newImageandbudgetedstay at their defaults, as #15301 passed neither.What #15301 wanted is kept: the standalone path of
BufferPool::AllocateImagestill allocates throughTakeImageMemorywithRefusedDeviceMemoryFallback(core/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp:778andcore/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp:779onmain), and the slab path falls back to that standalone path onVK_ERROR_OUT_OF_DEVICE_MEMORY(core/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp:810andcore/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp:811onmain). The difference from #15301 as written is that a shadow small enough for an image slab can now be placed in a shared 4 MiB block, as #10472 does for the other sampled images.hugodearaujo noted the same break on #15710 and patched it locally to the mask form of
AllocateImageMemoryto test that merge; that patch is not in any PR. I took theOwnedImage::Allocateform instead so the shadow follows #10472's allocator like the otherOwnedImageusers.Tested
Windows 11 Pro 10.0.26300, WinLibs GCC 15.2, Release, AMD Radeon RX 9070 XT (driver 32.0.32015.12012), Vulkan SDK 1.4.363 validation layer.
main0263899e99, fresh configure on a clean checkout: buildingDepthSurface.cpp.objfails with the error above.d792684630(only commit on0263899e99):libSceAgcDriverbuilds.agc_driver_native_multisample_depth_testsandagc_driver_native_depth_bda_clear_tests(agc_driver_native_multisample_depth,agc_driver_native_depth_*), withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandctest -V: 18 of 18 pass on this branch (agc_driver_native_depth_driver_queued_fillreports Skipped on this device). NoVUID-orSYNC-HAZARDlines, and nowas not found but was requested by env var VK_INSTANCE_LAYERSline.mainitself doesn't build (first bullet above). The comparison side isfca7decda9,mainjust before #15301's merge: the same 18 tests, same environment, 18 of 18 pass with the same skip, noVUID-orSYNC-HAZARDlines.throwadded at the top ofcreateSampleShadowon this branch, 17 of the 18 fail (the 18th is the skipped one).tools/check_conventions.py --base upstream/mainon the committed head: all checks pass.tools/pr_overlap.py: 39 open PRs shareDepthSurface.cpp, and 19 of them conflict withmainso the tool couldn't compare lines. I compared those 19 and #15750 by hand against the range ofcreateSampleShadowin each PR's own base. Only #15750 (info.usageof the shadow, three lines above this change) and #13920 (aCommandBorrowline after the barrier setup) change lines inside the function; neither touches these lines, and this branch merges cleanly with #15750.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)🤖 Generated with Claude Code