fix(agc): evict resource-cache images with storage entries #3474
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3474"
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 014-code on 2026-10-11T11:09:03Z.
What
Fixes #3256.
The storage-image cache evicts images by its byte budget, but
ResourceCachecan retain the sameStorageTexturethrough a cachedShaderResourcesobject. Those entries are bounded only by count, so an image can remain alive after storage-cache eviction and its Vulkan allocation is not reflected in the storage-cache budget. A title that creates storage images for changing extents or addresses can therefore accumulate device-local allocations untilvkAllocateMemoryfails.This change removes resource-cache entries that reference an image immediately after that image leaves the storage cache. The implementation:
ResourceCache::RemoveImage()to remove all entries that read the evicted image;ShaderResourcesobjects through the activeRecorder, so Vulkan resources are destroyed only after submitted work can no longer use them.The regression test now uses a storage-image-only compute shader with the resource cache enabled. It verifies that the workload populates
ResourceCache, exercises the storage-cache budget, and checks both cache membership andweak_ptrlifetime after eviction. The test no longer depends on a host-imported output buffer or a specific discrete GPU.Tested
cmake --build build --target agc_driver_storage_cache_budget_tests --parallel 4VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.json SDL_VIDEODRIVER=dummy ./build/tests/agc_driver_storage_cache_budget_testsstorage cache budget tests passedpython tools/check_conventions.py --base origin/maingit diff --checkThe full project test suite was not run.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T11:26:16Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppL525core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppL2550Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T11:50:46Z.
Checked on RADV and CI's lavapipe:
agc_driver_storage_cache_budgetpasses, fails without the change (negative check), andstorage_one_slice_alias/storage_baseline_settledstill pass; conventions green. Merging.