fix(agc): skip null storage images in a dispatch's write ranges #7932
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7932"
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 m335671 on 2026-10-19T14:47:06Z.
What
DispatchWriteRanges(Execution/src/Driver/Memory/WrittenBuffers.cpp) decodes the T# of every written storage image element withDecodeTextureResourcebefore checking for a null base address.DecodeTextureResourcethrows on a null base (guest texture descriptor has a null base address), so theif (resource.baseAddress == 0) continue;after it never runs. A dispatch that writes a storage image slot whose descriptor is null makes the call throw instead of contributing no range.On
main, the only caller is theAPS5_PIPELINE_DISPATCHitem path (Dispatch.cpp, a cache hit with a recipe), so this needs the opt-in switch. I hit it on Sword of the Sea (PPSA25344) at boot with a local change that also pipelines dispatch-cache misses. The exception left the queue-0 worker and the title aborted:The fix checks
IsNullTextureResourcebefore decoding and skips the element. This is whatDrawWriteRangesalready does for draws; the existing test checks that case for draws.Tested
Windows 11 Pro 26200, RTX 4070, NVIDIA 617.42, WinLibs GCC 15.2.0, Release, on
maina4440ed93.agc_driver_draw_write_rangesnow also runsDispatchWriteRangeson the program it already builds, a written image next to a null one. It checks three things: the result is bounded, the real image is a write range, and nothing covers the null one.mainthe new check fails withAGC graphics: guest texture descriptor has a null base address.mainand on this PR (agc_driver_draw_write_ranges,agc_driver_pipelined_dispatch,agc_driver_pipelined_dispatch_item) withctest -V,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1. On both, the three pass. Neither log haswas not found but was requested by env var VK_INSTANCE_LAYERSor anyVUID-line. (Onmain,agc_driver_draw_write_rangesruns without the new check.)python tools/check_conventions.py --base origin/main: all checks passed.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
https://claude.ai/code/session_01PqKN8pgLXDvWRPSucJTLU7
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T14:59:51Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp