perf(agc): reuse readonly fallback copies #5469
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5469"
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 Sanjaysrinivas on 2026-10-13T20:35:31Z.
What
Retain immutable raw copies of tracked read-only fallback buffer regions through the recorder's existing storage-snapshot cache. Unchanged readers can bind the same buffer; writes are flushed and freshly collected before lookup so a CPU store within the same collection epoch cannot serve stale bytes. The existing cache supplies its entry/byte budgets and preserves buffers held by older consumers.
Reuse is limited to uploads holding the GPU mutex, using the active recorder on the same device, with a nonzero write-watch generation and a fully committed, live, non-addressable region that no descriptor writes. Writers, sparse regions, untracked memory and unlocked preparation keep separate copies.
APS5_NO_READONLY_FALLBACK_REUSE=1disables reuse for comparison;APS5_PROFILE_DRAWreports avoided logical copy footprints.Related open #1364 includes immutable buffer reuse alongside upload batching and shader-data streaming. This is a draft alternative for the reuse portion using current main's existing cache, with no batching or streaming redesign. Ordering with #1364 has not been agreed and needs maintainer/author coordination before this becomes ready for review. The checklist explicitly records that overlap rather than asserting its absence. No title FPS or frame-time improvement is claimed by this PR.
Tested
Fresh Release build against main
a0f5916a293067ca840e835e58a8a55a0b764b4b, Windows 11 Pro / MinGW-w64, SPIRV-Tools disabled, native NVIDIA Vulkan with Khronos validation and shader cache disabled.The new native fixture passes (0.556 s): unchanged-handle reuse, a CPU overwrite within one explicitly established collect epoch, queued GPU consumers retaining old bytes, writer bypass, a real GPU fill published before the next reader, generation-zero bypass, unlocked preparation, cache eviction with a live consumer, private recommit, shared-section CPU writes/remap at the same virtual address, and sparse descriptor clipping/bypass. Mapping changes use the existing allocation invalidation callback without registering the fallback memory for import. Disabling reuse in the identical binary fails at the expected unchanged-handle assertion (0.460 s).
CTest: 5/5 passed, covering the new fixture, unchanged CPU stamps, written-buffer ordering, copied-direct ordering and the draw snapshot cap (3.74 s total, each test below 1 s). The dedicated draw descriptor writes and snapshot override check also passed (0.450 s). No cases skipped or Vulkan validation errors reported. Linux/lavapipe and other hardware vendors have not been tested.
Checklist
main; open-PR overlap reviewed and disclosed: #1364 (draft alternative; ordering remains pending as described above).mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:26:14Z.
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.
Pull request closed