perf(agc): keep depth plane copies resident instead of remaking them on each use #10837

Merged
Raghav314 merged 3 commits from upstream-pr/10837 into main 2026-10-26 19:18:34 +00:00
Raghav314 commented 2026-10-25 03:46:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-25T03:46:24Z.


What

Depth plane copies (the sampleable copies made when a title samples several slices, or an integer view, of a depth surface) were remade on almost every use in Grand Theft Auto V's Fidelity mode. Two causes, one commit each:

  1. A copy's memory never went back to the device pool. DepthPlaneCopy built its OwnedImage without recording the memory's size or type, so an evicted copy's block was freed with vkFreeMemory instead of being kept, and the next copy allocated fresh memory. The constructor also reset the buffer pool, so its staging buffer bypassed the pool too. The copy now allocates through OwnedImage::Allocate, like the other texture copies, and leaves the pool alone.
  2. Every layer range of a surface got its own full copy. The cache key included the layer count, so a title sampling 6-, 5-, 4- and 3-layer arrays of the same surface made four copies of its layers 0..n-1. In GTA V that made a 305 MiB working set against the 256 MiB budget, so least-recently-used eviction missed on every use. Now there is one copy per surface, sized to the most layers requested (replaced when a request needs more). A request refreshes only its own layers, and its view covers exactly [baseArray, last] (a new layerCount on the depth Texture constructor, previously VK_REMAINING_ARRAY_LAYERS), so out-of-range layer indices still clamp to the texture's own last layer. In GTA V the working set drops to 9 copies and 91.5 MiB, and in steady state no copies are made or evicted.

Tested

Linux 7.3.0-3-cachyos, NVIDIA GeForce RTX 4090, driver 615.78.08, Release build with SPIR-V tools off. Grand Theft Auto V (PPSA04264) 01.011.001, Fidelity mode, 3840x2160, standing still at the same spot in game. Captured as the Performance report form describes: warm caches (each build had run the scene before and the title was restarted), APS5_TRACE_SECONDS=110:30 and no other APS5_TRACE_* or APS5_PROFILE_* switch, base and change on the same machine in the same session.

presents frame p50 p90 p99 GPU busy / present
main 52a8bed576 71 424.3 ms 443.5 ms 467.9 ms 254.0 ms
this PR ce9c6cbd6a 105 285.9 ms 305.4 ms 330.1 ms 230.4 ms

Summary lines:

{"commit":"52a8bed576e5","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"110:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 615.78.08","os":"Linux 7.3.0-3-cachyos","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31742,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 110:30","first_present":2635,"ms":30130.004},"presents":71,"frame_ms":{"p50":424.274,"p90":443.531,"p99":467.927,"max":467.927},"gpu_busy_ms_per_present":253.983,"worker_busy_pct":{"queue worker 0x0":99.778,"queue worker 0x38":35.159,"queue worker 0x20":84.067,"queue worker 0x28":59.370,"queue worker 0x30":57.585},"top_phases_ms_per_frame":{"Driver.Packet":1421.669,"Driver.Packet.memory_wait":881.917,"Driver.Packet.dispatch":407.765,"Driver.Dispatch":376.493,"Resources.Complete":292.760,"Vulkan.Dispatch":292.506,"Vulkan.Dispatch.shader_resources":291.039,"Recorder.Sync":114.630},"trace_dropped":false,"trace":"aps5-trace-52a8bed576e5-1400825.json.gz"}
{"commit":"ce9c6cbd6ab6","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"110:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 615.78.08","os":"Linux 7.3.0-3-cachyos","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31742,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 110:30","first_present":2782,"ms":30057.556},"presents":105,"frame_ms":{"p50":285.910,"p90":305.359,"p99":330.100,"max":347.130},"gpu_busy_ms_per_present":230.361,"worker_busy_pct":{"queue worker 0x0":99.632,"queue worker 0x20":85.138,"queue worker 0x28":57.109,"queue worker 0x30":39.919,"queue worker 0x38":31.444},"top_phases_ms_per_frame":{"Driver.Packet":887.891,"Driver.Packet.memory_wait":555.971,"Driver.Packet.dispatch":252.488,"Driver.Dispatch":233.429,"Recorder.WaitSerial":104.503,"Driver.Packet.draw":69.338,"Driver.Draw":69.113,"Vulkan.Dispatch":54.760},"trace_dropped":false,"trace":"aps5-trace-ce9c6cbd6ab6-1401969.json.gz"}

The traces are attached. Digests of both are below.
aps5-trace-52a8bed576e5-1400825.json.gz
aps5-trace-ce9c6cbd6ab6-1401969.json.gz

Focused tests on main and on this PR, same machine and GPU, with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation: agc_driver_depth_plane_buffer_memory_tests, _fill_, _guest_layers_, _partial_store_, _sampling_, agc_driver_depth_compare_copy_tests, agc_driver_depth_copy_draw_tests, agc_driver_depth_surface_from_storage_tests, agc_driver_depth_storage_reuse_tests, agc_driver_image_plane_address_on_cube_tests, agc_driver_depth_bits_guest_memory_tests. All pass on both, no log has was not found but was requested by env var VK_INSTANCE_LAYERS, and neither has a VUID- error.

New cases in DepthPlaneGuestLayers.cpp, both failing on main's code:

  • PooledPlaneCopies: two same-shape surfaces alternating under a 1 MiB budget. Main allocates device memory 18 times over three rounds; this PR allocates none.
  • SharedLayerRanges: after sampling layers 0-3 of four depth surfaces, sampling 0-2, 0-1, 1-2 and 0-3 again records no depth surface copies and no plane copy fills, and each view covers exactly its range. Main makes three surface copies and a fill for the 0-2 range.
trace_digest: main

seconds 110:30 from present 2635: 71 presents, frame p50 424.3 / p90 443.5 / p99 467.9 / max 467.9 ms, GPU busy 254.0 ms per present
NVIDIA GeForce RTX 4090, NVIDIA 615.78.08, Linux 7.3.0-3-cachyos, 3840x2160, commit 52a8bed576, dropped: no

{"commit":"52a8bed576e5","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"110:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 615.78.08","os":"Linux 7.3.0-3-cachyos","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31742,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 110:30","first_present":2635,"ms":30130.004},"presents":71,"frame_ms":{"p50":424.274,"p90":443.531,"p99":467.927,"max":467.927},"gpu_busy_ms_per_present":253.983,"worker_busy_pct":{"queue worker 0x0":99.778,"queue worker 0x38":35.159,"queue worker 0x20":84.067,"queue worker 0x28":59.37,"queue worker 0x30":57.585},"top_phases_ms_per_frame":{"Driver.Packet":1421.669,"Driver.Packet.memory_wait":881.917,"Driver.Packet.dispatch":407.765,"Driver.Dispatch":376.493,"Resources.Complete":292.76,"Vulkan.Dispatch":292.506,"Vulkan.Dispatch.shader_resources":291.039,"Recorder.Sync":114.63},"trace_dropped":false,"trace":"aps5-trace-52a8bed576e5-1400825.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2676: 467.9 ms at 17261 ms: Driver.WorkerWait (queue worker 0x28) 467.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 467.9, Driver.Packet (queue worker 0x20) 466.7, Driver.Packet (queue worker 0x38) 466.5
  • present 2654: 467.4 ms at 8139 ms: Driver.WorkerWait (queue worker 0x38) 467.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 467.4, Driver.WorkerWait (queue worker 0x28) 467.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 467.4
  • present 2677: 456.1 ms at 17729 ms: Driver.WorkerWait (queue worker 0x28) 456.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 456.1, Driver.WorkerWait (queue worker 0x30) 456.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 456.1
  • present 2653: 455.3 ms at 7684 ms: Driver.WorkerWait (queue worker 0x38) 455.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 455.3, Driver.Packet (queue worker 0x30) 455.2, Driver.Packet (queue worker 0x20) 453.9
  • present 2678: 448.0 ms at 18185 ms: Driver.WorkerWait (queue worker 0x30) 448.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 448.0, Driver.Packet (queue worker 0x28) 447.1, Driver.Packet.memory_wait (queue worker 0x28) 447.1

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 220.5 (52 %) 189.5 (45 %) 14.4 74.7 Driver.Packet 407.0, Driver.EndSubmission 1.9
draw committer 69.7 (16 %) 73.8 (17 %) 280.8 20.1 Graphics.Draw 48.1, Recorder.Submit 21.4
presenter 0.6 (0 %) 0.0 (0 %) 423.7 0.1 VideoOut.Flip 0.6, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 424.4 0.0 Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x38 59.2 (14 %) 311.4 (73 %) 53.8 0.0 Driver.Packet 149.1, Driver.EndSubmission 0.1
queue worker 0x20 45.9 (11 %) 372.5 (88 %) 6.0 7.8 Driver.Packet 350.8, Driver.EndSubmission 0.0
title 0.0 (0 %) 0.0 (0 %) 424.3 0.0 Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x28 81.7 (19 %) 339.6 (80 %) 3.1 2.2 Driver.Packet 251.5, Driver.EndSubmission 0.2
queue worker 0x30 98.6 (23 %) 307.9 (73 %) 17.8 0.7 Driver.Packet 244.0, Driver.EndSubmission 0.3
title 0.0 (0 %) 0.0 (0 %) 424.4 0.0 Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 424.4 0.0
gpu 253.8 (60 %) 0.0 (0 %) 170.6 0.0 batch 253.8

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 1402.3, Driver.Packet.memory_wait 876.8, Driver.WorkerWait 620.7, Driver.WorkerWait.idle_and_completion_poll 620.7, Driver.Packet.dispatch 406.6, Driver.Dispatch 374.7, Resources.Complete 291.9, Vulkan.Dispatch 291.0, Vulkan.Dispatch.shader_resources 289.8, batch 253.8

Longest waits

  • Driver.WorkerWait (queue worker 0x38) 5842.4 ms at 11420 ms, present 2661
  • Driver.WorkerWait (queue worker 0x38) 3603.1 ms at 5873 ms, present 2648
  • Driver.WorkerWait (queue worker 0x30) 2913.5 ms at 24760 ms, present 2693
  • Driver.WorkerWait (queue worker 0x28) 2289.4 ms at 19830 ms, present 2681
  • Driver.WorkerWait (queue worker 0x38) 2260.9 ms at 23318 ms, present 2689
  • Driver.WorkerWait (queue worker 0x28) 1833.1 ms at 314 ms, present 2635
  • Driver.WorkerWait (queue worker 0x38) 1412.1 ms at 21155 ms, present 2684
  • Driver.WorkerWait (queue worker 0x30) 1379.0 ms at 9773 ms, present 2657
  • Driver.WorkerWait (queue worker 0x30) 1032.0 ms at 22407 ms, present 2687
  • Driver.WorkerWait (queue worker 0x30) 1028.4 ms at 17606 ms, present 2676

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 4036: 188.2 ms at 17389 ms, present 2676: GPU no ranges; recorded by Recorder.Sync (queue worker 0x30) 188.4, Driver.Packet (queue worker 0x30) 52.5, Driver.Packet.dispatch (queue worker 0x30) 52.5, Driver.Dispatch (queue worker 0x30) 52.4
  • batch 4162: 166.3 ms at 17866 ms, present 2677: GPU no ranges; recorded by Recorder.Sync (queue worker 0x38) 166.4, Driver.Packet (queue worker 0x38) 47.7, Driver.Packet.dispatch (queue worker 0x38) 47.7, Driver.Dispatch (queue worker 0x38) 47.7
  • batch 4351: 166.2 ms at 18723 ms, present 2679: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 41.9, Graphics.Draw (draw committer) 0.2, Graphics.Draw.draw_and_resource_release (draw committer) 0.2, Recorder.Submit (draw committer) 0.0
  • batch 1533: 164.6 ms at 6508 ms, present 2650: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 44.4, Graphics.Draw (draw committer) 0.3, Graphics.Draw.draw_and_resource_release (draw committer) 0.2, Recorder.Submit (draw committer) 0.0
  • batch 2001: 161.8 ms at 8699 ms, present 2655: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 44.0, Graphics.Draw (draw committer) 0.2, Graphics.Draw.draw_and_resource_release (draw committer) 0.1, Recorder.Submit (draw committer) 0.0
trace_digest: this PR

seconds 110:30 from present 2782: 105 presents, frame p50 285.9 / p90 305.4 / p99 330.1 / max 347.1 ms, GPU busy 230.4 ms per present
NVIDIA GeForce RTX 4090, NVIDIA 615.78.08, Linux 7.3.0-3-cachyos, 3840x2160, commit ce9c6cbd6a, dropped: no

{"commit":"ce9c6cbd6ab6","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"110:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 615.78.08","os":"Linux 7.3.0-3-cachyos","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31742,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 110:30","first_present":2782,"ms":30057.556},"presents":105,"frame_ms":{"p50":285.91,"p90":305.359,"p99":330.1,"max":347.13},"gpu_busy_ms_per_present":230.361,"worker_busy_pct":{"queue worker 0x0":99.632,"queue worker 0x20":85.138,"queue worker 0x28":57.109,"queue worker 0x30":39.919,"queue worker 0x38":31.444},"top_phases_ms_per_frame":{"Driver.Packet":887.891,"Driver.Packet.memory_wait":555.971,"Driver.Packet.dispatch":252.488,"Driver.Dispatch":233.429,"Recorder.WaitSerial":104.503,"Driver.Packet.draw":69.338,"Driver.Draw":69.113,"Vulkan.Dispatch":54.76},"trace_dropped":false,"trace":"aps5-trace-ce9c6cbd6ab6-1401969.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2802: 347.1 ms at 5770 ms: Driver.WorkerWait (queue worker 0x38) 347.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 347.1, Driver.Packet (queue worker 0x28) 346.0, Driver.Packet (queue worker 0x20) 345.4
  • present 2804: 330.1 ms at 6439 ms: Driver.WorkerWait (queue worker 0x30) 330.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 330.1, Driver.Packet (queue worker 0x38) 329.2, Driver.Packet.memory_wait (queue worker 0x38) 329.2
  • present 2803: 321.8 ms at 6117 ms: Driver.WorkerWait (queue worker 0x30) 321.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 321.8, Driver.WorkerWait (queue worker 0x38) 321.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 321.8
  • present 2822: 321.5 ms at 11902 ms: Driver.WorkerWait (queue worker 0x30) 321.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 321.5, Driver.WorkerWait (queue worker 0x38) 321.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 321.5
  • present 2806: 318.7 ms at 7074 ms: Driver.WorkerWait (queue worker 0x30) 318.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 318.7, Driver.Packet (queue worker 0x20) 318.6, Driver.Packet (queue worker 0x38) 317.5

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 125.9 (44 %) 145.5 (51 %) 14.9 79.0 Driver.Packet 263.0, Driver.EndSubmission 7.1
draw committer 46.7 (16 %) 8.6 (3 %) 231.0 21.0 Graphics.Draw 46.3, Recorder.Sync 0.3
presenter 0.6 (0 %) 0.1 (0 %) 285.6 0.1 VideoOut.Flip 0.6, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 286.3 0.0 Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 286.3 0.0 Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x20 31.5 (11 %) 248.9 (87 %) 5.9 7.9 Driver.Packet 242.9, Driver.EndSubmission 0.0
queue worker 0x28 24.4 (9 %) 259.5 (91 %) 2.4 1.9 Driver.Packet 163.3, Driver.EndSubmission 0.0
title 0.0 (0 %) 0.0 (0 %) 286.3 0.0 Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x30 16.3 (6 %) 245.6 (86 %) 24.4 0.4 Driver.Packet 114.2, Driver.EndSubmission 0.0
queue worker 0x38 12.7 (4 %) 263.2 (92 %) 10.3 0.1 Driver.Packet 90.0, Driver.EndSubmission 0.0
title 0.0 (0 %) 0.0 (0 %) 286.3 0.0 Shader.ResolveGraphicsStagesAbi 0.0
gpu 230.4 (80 %) 0.0 (0 %) 55.9 0.0 batch 230.4

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 873.3, Driver.Packet.memory_wait 556.0, Driver.WorkerWait 491.7, Driver.WorkerWait.idle_and_completion_poll 491.7, Driver.Packet.dispatch 251.4, Driver.Dispatch 231.7, batch 230.4, Recorder.WaitSerial 104.5, Driver.Packet.draw 59.4, Driver.Draw 59.1

Longest waits

  • Driver.WorkerWait (queue worker 0x38) 3175.8 ms at 18365 ms, present 2845
  • Driver.WorkerWait (queue worker 0x38) 3029.0 ms at 25016 ms, present 2869
  • Driver.WorkerWait (queue worker 0x38) 2208.6 ms at 11431 ms, present 2820
  • Driver.WorkerWait (queue worker 0x38) 1999.6 ms at 4440 ms, present 2797
  • Driver.WorkerWait (queue worker 0x30) 1872.0 ms at 23351 ms, present 2863
  • Driver.WorkerWait (queue worker 0x30) 1842.7 ms at 14816 ms, present 2832
  • Driver.WorkerWait (queue worker 0x30) 1654.0 ms at 3269 ms, present 2793
  • Driver.WorkerWait (queue worker 0x30) 1522.0 ms at 5873 ms, present 2802
  • Driver.WorkerWait (queue worker 0x38) 1249.3 ms at 16737 ms, present 2839
  • Driver.WorkerWait (queue worker 0x30) 1229.8 ms at 18094 ms, present 2844

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 2151: 190.6 ms at 5873 ms, present 2802: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x30) 1522.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 1522.0, Driver.Packet (queue worker 0x30) 357.1, Driver.Packet.memory_wait (queue worker 0x30) 317.4
  • batch 2703: 180.1 ms at 7493 ms, present 2807: GPU no ranges; recorded by Driver.Packet (queue worker 0x38) 403.4, Driver.Packet.memory_wait (queue worker 0x38) 368.6, Driver.WorkerWait (queue worker 0x38) 219.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 219.7
  • batch 2593: 179.6 ms at 7179 ms, present 2806: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 254.9, Driver.Packet.memory_wait (queue worker 0x20) 215.0, Driver.Packet.dispatch (queue worker 0x20) 39.9, Driver.Dispatch (queue worker 0x20) 35.6
  • batch 2272: 177.2 ms at 6209 ms, present 2803: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 33.1, Driver.Packet.memory_wait (queue worker 0x0) 32.8, Driver.Dispatch.materialize (queue worker 0x0) 10.6, Resources.Prepare (queue worker 0x0) 1.7
  • batch 2809: 174.8 ms at 7818 ms, present 2808: GPU no ranges; recorded by Driver.Packet (queue worker 0x28) 392.6, Driver.Packet.memory_wait (queue worker 0x28) 351.1, Driver.WorkerWait (queue worker 0x28) 212.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 212.4

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4090, driver 615.78.08, Linux 7.3.0-3-cachyos
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5001568902 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10837). Originally posted by [Raghav314](https://github.com/Raghav314) on 2026-10-25T03:46:24Z. --- ### What Depth plane copies (the sampleable copies made when a title samples several slices, or an integer view, of a depth surface) were remade on almost every use in Grand Theft Auto V's Fidelity mode. Two causes, one commit each: 1. **A copy's memory never went back to the device pool.** `DepthPlaneCopy` built its `OwnedImage` without recording the memory's size or type, so an evicted copy's block was freed with `vkFreeMemory` instead of being kept, and the next copy allocated fresh memory. The constructor also reset the buffer pool, so its staging buffer bypassed the pool too. The copy now allocates through `OwnedImage::Allocate`, like the other texture copies, and leaves the pool alone. 2. **Every layer range of a surface got its own full copy.** The cache key included the layer count, so a title sampling 6-, 5-, 4- and 3-layer arrays of the same surface made four copies of its layers 0..n-1. In GTA V that made a 305 MiB working set against the 256 MiB budget, so least-recently-used eviction missed on every use. Now there is one copy per surface, sized to the most layers requested (replaced when a request needs more). A request refreshes only its own layers, and its view covers exactly `[baseArray, last]` (a new `layerCount` on the depth `Texture` constructor, previously `VK_REMAINING_ARRAY_LAYERS`), so out-of-range layer indices still clamp to the texture's own last layer. In GTA V the working set drops to 9 copies and 91.5 MiB, and in steady state no copies are made or evicted. ### Tested Linux 7.3.0-3-cachyos, NVIDIA GeForce RTX 4090, driver 615.78.08, Release build with SPIR-V tools off. Grand Theft Auto V (PPSA04264) 01.011.001, Fidelity mode, 3840x2160, standing still at the same spot in game. Captured as the Performance report form describes: warm caches (each build had run the scene before and the title was restarted), `APS5_TRACE_SECONDS=110:30` and no other `APS5_TRACE_*` or `APS5_PROFILE_*` switch, base and change on the same machine in the same session. | | presents | frame p50 | p90 | p99 | GPU busy / present | |---|---|---|---|---|---| | main 52a8bed576 | 71 | 424.3 ms | 443.5 ms | 467.9 ms | 254.0 ms | | this PR ce9c6cbd6a | 105 | 285.9 ms | 305.4 ms | 330.1 ms | 230.4 ms | Summary lines: ```json {"commit":"52a8bed576e5","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"110:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 615.78.08","os":"Linux 7.3.0-3-cachyos","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31742,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 110:30","first_present":2635,"ms":30130.004},"presents":71,"frame_ms":{"p50":424.274,"p90":443.531,"p99":467.927,"max":467.927},"gpu_busy_ms_per_present":253.983,"worker_busy_pct":{"queue worker 0x0":99.778,"queue worker 0x38":35.159,"queue worker 0x20":84.067,"queue worker 0x28":59.370,"queue worker 0x30":57.585},"top_phases_ms_per_frame":{"Driver.Packet":1421.669,"Driver.Packet.memory_wait":881.917,"Driver.Packet.dispatch":407.765,"Driver.Dispatch":376.493,"Resources.Complete":292.760,"Vulkan.Dispatch":292.506,"Vulkan.Dispatch.shader_resources":291.039,"Recorder.Sync":114.630},"trace_dropped":false,"trace":"aps5-trace-52a8bed576e5-1400825.json.gz"} {"commit":"ce9c6cbd6ab6","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"110:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 615.78.08","os":"Linux 7.3.0-3-cachyos","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31742,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 110:30","first_present":2782,"ms":30057.556},"presents":105,"frame_ms":{"p50":285.910,"p90":305.359,"p99":330.100,"max":347.130},"gpu_busy_ms_per_present":230.361,"worker_busy_pct":{"queue worker 0x0":99.632,"queue worker 0x20":85.138,"queue worker 0x28":57.109,"queue worker 0x30":39.919,"queue worker 0x38":31.444},"top_phases_ms_per_frame":{"Driver.Packet":887.891,"Driver.Packet.memory_wait":555.971,"Driver.Packet.dispatch":252.488,"Driver.Dispatch":233.429,"Recorder.WaitSerial":104.503,"Driver.Packet.draw":69.338,"Driver.Draw":69.113,"Vulkan.Dispatch":54.760},"trace_dropped":false,"trace":"aps5-trace-ce9c6cbd6ab6-1401969.json.gz"} ``` The traces are attached. Digests of both are below. [aps5-trace-52a8bed576e5-1400825.json.gz](https://github.com/user-attachments/files/33918454/aps5-trace-52a8bed576e5-1400825.json.gz) [aps5-trace-ce9c6cbd6ab6-1401969.json.gz](https://github.com/user-attachments/files/33918455/aps5-trace-ce9c6cbd6ab6-1401969.json.gz) Focused tests on main and on this PR, same machine and GPU, with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`: `agc_driver_depth_plane_buffer_memory_tests`, `_fill_`, `_guest_layers_`, `_partial_store_`, `_sampling_`, `agc_driver_depth_compare_copy_tests`, `agc_driver_depth_copy_draw_tests`, `agc_driver_depth_surface_from_storage_tests`, `agc_driver_depth_storage_reuse_tests`, `agc_driver_image_plane_address_on_cube_tests`, `agc_driver_depth_bits_guest_memory_tests`. All pass on both, no log has `was not found but was requested by env var VK_INSTANCE_LAYERS`, and neither has a `VUID-` error. New cases in `DepthPlaneGuestLayers.cpp`, both failing on main's code: - `PooledPlaneCopies`: two same-shape surfaces alternating under a 1 MiB budget. Main allocates device memory 18 times over three rounds; this PR allocates none. - `SharedLayerRanges`: after sampling layers 0-3 of four depth surfaces, sampling 0-2, 0-1, 1-2 and 0-3 again records no depth surface copies and no plane copy fills, and each view covers exactly its range. Main makes three surface copies and a fill for the 0-2 range. <details><summary>trace_digest: main</summary> **seconds 110:30** from present 2635: 71 presents, frame p50 424.3 / p90 443.5 / p99 467.9 / max 467.9 ms, GPU busy 254.0 ms per present NVIDIA GeForce RTX 4090, NVIDIA 615.78.08, Linux 7.3.0-3-cachyos, 3840x2160, commit 52a8bed576e5, dropped: no ```json {"commit":"52a8bed576e5","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"110:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 615.78.08","os":"Linux 7.3.0-3-cachyos","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31742,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 110:30","first_present":2635,"ms":30130.004},"presents":71,"frame_ms":{"p50":424.274,"p90":443.531,"p99":467.927,"max":467.927},"gpu_busy_ms_per_present":253.983,"worker_busy_pct":{"queue worker 0x0":99.778,"queue worker 0x38":35.159,"queue worker 0x20":84.067,"queue worker 0x28":59.37,"queue worker 0x30":57.585},"top_phases_ms_per_frame":{"Driver.Packet":1421.669,"Driver.Packet.memory_wait":881.917,"Driver.Packet.dispatch":407.765,"Driver.Dispatch":376.493,"Resources.Complete":292.76,"Vulkan.Dispatch":292.506,"Vulkan.Dispatch.shader_resources":291.039,"Recorder.Sync":114.63},"trace_dropped":false,"trace":"aps5-trace-52a8bed576e5-1400825.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 2676: 467.9 ms at 17261 ms: Driver.WorkerWait (queue worker 0x28) 467.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 467.9, Driver.Packet (queue worker 0x20) 466.7, Driver.Packet (queue worker 0x38) 466.5 - present 2654: 467.4 ms at 8139 ms: Driver.WorkerWait (queue worker 0x38) 467.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 467.4, Driver.WorkerWait (queue worker 0x28) 467.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 467.4 - present 2677: 456.1 ms at 17729 ms: Driver.WorkerWait (queue worker 0x28) 456.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 456.1, Driver.WorkerWait (queue worker 0x30) 456.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 456.1 - present 2653: 455.3 ms at 7684 ms: Driver.WorkerWait (queue worker 0x38) 455.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 455.3, Driver.Packet (queue worker 0x30) 455.2, Driver.Packet (queue worker 0x20) 453.9 - present 2678: 448.0 ms at 18185 ms: Driver.WorkerWait (queue worker 0x30) 448.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 448.0, Driver.Packet (queue worker 0x28) 447.1, Driver.Packet.memory_wait (queue worker 0x28) 447.1 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 220.5 (52 %) | 189.5 (45 %) | 14.4 | 74.7 | Driver.Packet 407.0, Driver.EndSubmission 1.9 | | draw committer | 69.7 (16 %) | 73.8 (17 %) | 280.8 | 20.1 | Graphics.Draw 48.1, Recorder.Submit 21.4 | | presenter | 0.6 (0 %) | 0.0 (0 %) | 423.7 | 0.1 | VideoOut.Flip 0.6, Driver.Present 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 424.4 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x38 | 59.2 (14 %) | 311.4 (73 %) | 53.8 | 0.0 | Driver.Packet 149.1, Driver.EndSubmission 0.1 | | queue worker 0x20 | 45.9 (11 %) | 372.5 (88 %) | 6.0 | 7.8 | Driver.Packet 350.8, Driver.EndSubmission 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 424.3 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x28 | 81.7 (19 %) | 339.6 (80 %) | 3.1 | 2.2 | Driver.Packet 251.5, Driver.EndSubmission 0.2 | | queue worker 0x30 | 98.6 (23 %) | 307.9 (73 %) | 17.8 | 0.7 | Driver.Packet 244.0, Driver.EndSubmission 0.3 | | title | 0.0 (0 %) | 0.0 (0 %) | 424.4 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 424.4 | 0.0 | | | gpu | 253.8 (60 %) | 0.0 (0 %) | 170.6 | 0.0 | batch 253.8 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 1402.3, Driver.Packet.memory_wait 876.8, Driver.WorkerWait 620.7, Driver.WorkerWait.idle_and_completion_poll 620.7, Driver.Packet.dispatch 406.6, Driver.Dispatch 374.7, Resources.Complete 291.9, Vulkan.Dispatch 291.0, Vulkan.Dispatch.shader_resources 289.8, batch 253.8 **Longest waits** - Driver.WorkerWait (queue worker 0x38) 5842.4 ms at 11420 ms, present 2661 - Driver.WorkerWait (queue worker 0x38) 3603.1 ms at 5873 ms, present 2648 - Driver.WorkerWait (queue worker 0x30) 2913.5 ms at 24760 ms, present 2693 - Driver.WorkerWait (queue worker 0x28) 2289.4 ms at 19830 ms, present 2681 - Driver.WorkerWait (queue worker 0x38) 2260.9 ms at 23318 ms, present 2689 - Driver.WorkerWait (queue worker 0x28) 1833.1 ms at 314 ms, present 2635 - Driver.WorkerWait (queue worker 0x38) 1412.1 ms at 21155 ms, present 2684 - Driver.WorkerWait (queue worker 0x30) 1379.0 ms at 9773 ms, present 2657 - Driver.WorkerWait (queue worker 0x30) 1032.0 ms at 22407 ms, present 2687 - Driver.WorkerWait (queue worker 0x30) 1028.4 ms at 17606 ms, present 2676 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 4036: 188.2 ms at 17389 ms, present 2676: GPU no ranges; recorded by Recorder.Sync (queue worker 0x30) 188.4, Driver.Packet (queue worker 0x30) 52.5, Driver.Packet.dispatch (queue worker 0x30) 52.5, Driver.Dispatch (queue worker 0x30) 52.4 - batch 4162: 166.3 ms at 17866 ms, present 2677: GPU no ranges; recorded by Recorder.Sync (queue worker 0x38) 166.4, Driver.Packet (queue worker 0x38) 47.7, Driver.Packet.dispatch (queue worker 0x38) 47.7, Driver.Dispatch (queue worker 0x38) 47.7 - batch 4351: 166.2 ms at 18723 ms, present 2679: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 41.9, Graphics.Draw (draw committer) 0.2, Graphics.Draw.draw_and_resource_release (draw committer) 0.2, Recorder.Submit (draw committer) 0.0 - batch 1533: 164.6 ms at 6508 ms, present 2650: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 44.4, Graphics.Draw (draw committer) 0.3, Graphics.Draw.draw_and_resource_release (draw committer) 0.2, Recorder.Submit (draw committer) 0.0 - batch 2001: 161.8 ms at 8699 ms, present 2655: GPU no ranges; recorded by GpuMutex.wait.draw (draw committer) 44.0, Graphics.Draw (draw committer) 0.2, Graphics.Draw.draw_and_resource_release (draw committer) 0.1, Recorder.Submit (draw committer) 0.0 </details> <details><summary>trace_digest: this PR</summary> **seconds 110:30** from present 2782: 105 presents, frame p50 285.9 / p90 305.4 / p99 330.1 / max 347.1 ms, GPU busy 230.4 ms per present NVIDIA GeForce RTX 4090, NVIDIA 615.78.08, Linux 7.3.0-3-cachyos, 3840x2160, commit ce9c6cbd6ab6, dropped: no ```json {"commit":"ce9c6cbd6ab6","dirty":false,"env":{"APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"110:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 615.78.08","os":"Linux 7.3.0-3-cachyos","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31742,"title_id":"PPSA04264","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 110:30","first_present":2782,"ms":30057.556},"presents":105,"frame_ms":{"p50":285.91,"p90":305.359,"p99":330.1,"max":347.13},"gpu_busy_ms_per_present":230.361,"worker_busy_pct":{"queue worker 0x0":99.632,"queue worker 0x20":85.138,"queue worker 0x28":57.109,"queue worker 0x30":39.919,"queue worker 0x38":31.444},"top_phases_ms_per_frame":{"Driver.Packet":887.891,"Driver.Packet.memory_wait":555.971,"Driver.Packet.dispatch":252.488,"Driver.Dispatch":233.429,"Recorder.WaitSerial":104.503,"Driver.Packet.draw":69.338,"Driver.Draw":69.113,"Vulkan.Dispatch":54.76},"trace_dropped":false,"trace":"aps5-trace-ce9c6cbd6ab6-1401969.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 2802: 347.1 ms at 5770 ms: Driver.WorkerWait (queue worker 0x38) 347.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 347.1, Driver.Packet (queue worker 0x28) 346.0, Driver.Packet (queue worker 0x20) 345.4 - present 2804: 330.1 ms at 6439 ms: Driver.WorkerWait (queue worker 0x30) 330.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 330.1, Driver.Packet (queue worker 0x38) 329.2, Driver.Packet.memory_wait (queue worker 0x38) 329.2 - present 2803: 321.8 ms at 6117 ms: Driver.WorkerWait (queue worker 0x30) 321.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 321.8, Driver.WorkerWait (queue worker 0x38) 321.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 321.8 - present 2822: 321.5 ms at 11902 ms: Driver.WorkerWait (queue worker 0x30) 321.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 321.5, Driver.WorkerWait (queue worker 0x38) 321.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 321.5 - present 2806: 318.7 ms at 7074 ms: Driver.WorkerWait (queue worker 0x30) 318.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 318.7, Driver.Packet (queue worker 0x20) 318.6, Driver.Packet (queue worker 0x38) 317.5 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 125.9 (44 %) | 145.5 (51 %) | 14.9 | 79.0 | Driver.Packet 263.0, Driver.EndSubmission 7.1 | | draw committer | 46.7 (16 %) | 8.6 (3 %) | 231.0 | 21.0 | Graphics.Draw 46.3, Recorder.Sync 0.3 | | presenter | 0.6 (0 %) | 0.1 (0 %) | 285.6 | 0.1 | VideoOut.Flip 0.6, Driver.Present 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 286.3 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 286.3 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x20 | 31.5 (11 %) | 248.9 (87 %) | 5.9 | 7.9 | Driver.Packet 242.9, Driver.EndSubmission 0.0 | | queue worker 0x28 | 24.4 (9 %) | 259.5 (91 %) | 2.4 | 1.9 | Driver.Packet 163.3, Driver.EndSubmission 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 286.3 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x30 | 16.3 (6 %) | 245.6 (86 %) | 24.4 | 0.4 | Driver.Packet 114.2, Driver.EndSubmission 0.0 | | queue worker 0x38 | 12.7 (4 %) | 263.2 (92 %) | 10.3 | 0.1 | Driver.Packet 90.0, Driver.EndSubmission 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 286.3 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | gpu | 230.4 (80 %) | 0.0 (0 %) | 55.9 | 0.0 | batch 230.4 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 873.3, Driver.Packet.memory_wait 556.0, Driver.WorkerWait 491.7, Driver.WorkerWait.idle_and_completion_poll 491.7, Driver.Packet.dispatch 251.4, Driver.Dispatch 231.7, batch 230.4, Recorder.WaitSerial 104.5, Driver.Packet.draw 59.4, Driver.Draw 59.1 **Longest waits** - Driver.WorkerWait (queue worker 0x38) 3175.8 ms at 18365 ms, present 2845 - Driver.WorkerWait (queue worker 0x38) 3029.0 ms at 25016 ms, present 2869 - Driver.WorkerWait (queue worker 0x38) 2208.6 ms at 11431 ms, present 2820 - Driver.WorkerWait (queue worker 0x38) 1999.6 ms at 4440 ms, present 2797 - Driver.WorkerWait (queue worker 0x30) 1872.0 ms at 23351 ms, present 2863 - Driver.WorkerWait (queue worker 0x30) 1842.7 ms at 14816 ms, present 2832 - Driver.WorkerWait (queue worker 0x30) 1654.0 ms at 3269 ms, present 2793 - Driver.WorkerWait (queue worker 0x30) 1522.0 ms at 5873 ms, present 2802 - Driver.WorkerWait (queue worker 0x38) 1249.3 ms at 16737 ms, present 2839 - Driver.WorkerWait (queue worker 0x30) 1229.8 ms at 18094 ms, present 2844 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 2151: 190.6 ms at 5873 ms, present 2802: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x30) 1522.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x30) 1522.0, Driver.Packet (queue worker 0x30) 357.1, Driver.Packet.memory_wait (queue worker 0x30) 317.4 - batch 2703: 180.1 ms at 7493 ms, present 2807: GPU no ranges; recorded by Driver.Packet (queue worker 0x38) 403.4, Driver.Packet.memory_wait (queue worker 0x38) 368.6, Driver.WorkerWait (queue worker 0x38) 219.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x38) 219.7 - batch 2593: 179.6 ms at 7179 ms, present 2806: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 254.9, Driver.Packet.memory_wait (queue worker 0x20) 215.0, Driver.Packet.dispatch (queue worker 0x20) 39.9, Driver.Dispatch (queue worker 0x20) 35.6 - batch 2272: 177.2 ms at 6209 ms, present 2803: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 33.1, Driver.Packet.memory_wait (queue worker 0x0) 32.8, Driver.Dispatch.materialize (queue worker 0x0) 10.6, Resources.Prepare (queue worker 0x0) 1.7 - batch 2809: 174.8 ms at 7818 ms, present 2808: GPU no ranges; recorded by Driver.Packet (queue worker 0x28) 392.6, Driver.Packet.memory_wait (queue worker 0x28) 351.1, Driver.WorkerWait (queue worker 0x28) 212.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 212.4 </details> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 4090, driver 615.78.08, Linux 7.3.0-3-cachyos - [x] AI-assisted: yes
MarcZX10 commented 2026-10-25 03:54:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T03:54:18Z.

Review: APPROVED


Reviewed head ce9c6cbd6ab65fa81354cc9ed275d9181a3ca053. The copy now gets image memory through OwnedImage::Allocate, so release returns it to the device pool; the cache keeps one copy sized for the largest layer request and creates views with the requested array range. The new tests cover memory reuse after eviction and reuse across smaller layer ranges. I syntax-compiled the changed DepthSurface.cpp, Texture.cpp, and DepthPlaneGuestLayers.cpp using this project's Linux compile flags; all passed. Conventions, intake, labels, and report checks pass. Product build/test CI was skipped. The paired RTX 4090 trace and validation results in the PR body are detailed and appropriately scoped; I could not run the Vulkan tests on this host because its CPU lacks the runtime's required instruction set. I found no blocking code issue.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5641403841 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10837#pullrequestreview-5641403841). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T03:54:18Z. **Review:** APPROVED --- Reviewed head `ce9c6cbd6ab65fa81354cc9ed275d9181a3ca053`. The copy now gets image memory through `OwnedImage::Allocate`, so release returns it to the device pool; the cache keeps one copy sized for the largest layer request and creates views with the requested array range. The new tests cover memory reuse after eviction and reuse across smaller layer ranges. I syntax-compiled the changed `DepthSurface.cpp`, `Texture.cpp`, and `DepthPlaneGuestLayers.cpp` using this project's Linux compile flags; all passed. Conventions, intake, labels, and report checks pass. Product build/test CI was skipped. The paired RTX 4090 trace and validation results in the PR body are detailed and appropriately scoped; I could not run the Vulkan tests on this host because its CPU lacks the runtime's required instruction set. I found no blocking code issue.
MarcZX10 commented 2026-10-25 04:34:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T04:34:44Z.

Review: COMMENTED


One merge-order clarification after reviewing #10844: its PR body includes a second GTA V comparison made from this head plus #10844's commit (136d978b27), while correctly saying #10844 applies to main independently. That makes the second measurement useful combined evidence, but it does not make this PR depend on #10844. Please keep the merge-order description explicit if either PR lands first: the combined result is a cherry-pick composition, not a required dependency or a measurement of this head alone. I found no code blocker in this review; the existing exact-head approval remains applicable.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5641519611 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10837#pullrequestreview-5641519611). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T04:34:44Z. **Review:** COMMENTED --- One merge-order clarification after reviewing #10844: its PR body includes a second GTA V comparison made from this head plus #10844's commit (`136d978b27`), while correctly saying #10844 applies to `main` independently. That makes the second measurement useful combined evidence, but it does not make this PR depend on #10844. Please keep the merge-order description explicit if either PR lands first: the combined result is a cherry-pick composition, not a required dependency or a measurement of this head alone. I found no code blocker in this review; the existing exact-head approval remains applicable.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!10837
No description provided.