fix(agc): drop stale depth planes a uniform fill overwrites #10882

Merged
orezraey merged 7 commits from upstream-pr/10882 into main 2026-11-04 04:48:52 +00:00
orezraey commented 2026-10-25 07:11:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orezraey on 2026-10-25T07:11:56Z.


What

A depth target drawn on the host leaves its plane stale: the results live in the host depth image and are stored to guest memory when something reads that memory. A uniform buffer fill over the whole plane (a depth clear done as a memory fill) is such a read: storeBufferFill calls StorageTexture::FlushPending, which calls FlushDepthPlanes, so the stale plane was stored in full, and the fill then overwrote every byte of it. DEATHLOOP (PPSA01670) clears two 3840x2160 D32 planes this way every frame, 32 MiB each.

  • DiscardFilledDepthPlanes (new, called by storeBufferFill for uniform fills before its flushes): a stale single-sample depth plane that the fill covers entirely, with a value NoteDepthMetadataFill would turn into a plane clear (a depth in 0..1, or a D16 pair; no HTILE fill over the target), drops its stale units instead of storing them and notes the plane clear itself (NotePlaneFill), so the host image is cleared to the filled value at its next use. Partial fills, fills of other values, planes that are syncing, and fills that a native multisample colour target absorbs (they never reach guest memory) are stored as before.
  • Rebuilding the stale-plane index keeps the ranges of pending stencil planes, as the rebuild in FlushDepthPlanes does, so a later read of a stencil plane still stores it after a fill discards a depth plane. agc_driver_depth_plane_fill_discard covers a stencil-only surface beside the discarded plane and a surface with both planes stale.
  • It notes the clear itself because the pipelined DMA fill path (enqueueDmaPacket) does not reach preparePacketMemory, so NoteDepthMetadataFill is not called for those fills.
  • planeFillDepth is the plane test both NoteDepthMetadataFill and the drop use, so they cannot disagree.
  • A fill that touches no stale plane returns after the existing overlapsStalePlane check, without the surfaces lock.
  • agc_driver_depth_plane_fill_discard: a stale 384x200 Z_X plane is kept by a shorter fill, a fill starting past it, a fill of -1.0 and a NaN fill; a fill of 1.0 around it drops it with no store counted, and a draw at 0.5 then passes LESS (the plane was cleared to 1.0) with no NoteDepthMetadataFill call; an exact fill drops it once; a fill of 0.0 makes the same draw fail LESS. It then calls Driver::storeBufferFill itself (through DriverTestAccess) with a fill of 0.75 over a stale plane: no store is counted, the plane holds 0.75, a draw at 0.5 passes LESS and a later read stores nothing. With the storeBufferFill call removed, that part fails with "the driver's fill of 0.75 over the whole stale plane stored the plane first".

This PR makes no frame-time claim; see the captures below.

Tested

Windows 11 Pro 26200, AMD Ryzen 7 9700X, NVIDIA GeForce RTX 5070 Ti (driver 616.64), WinLibs GCC, Release. Head 591da8f4df, which contains main e67cc81869.

  • ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R "depth|fill|storage|stencil" -V, 3 runs at 591da8f4df and 1 at e67cc81869: 99 of 102 pass each time on the head and 98 of 101 on main, 0 VUID- and no missing-layer message in any log. The extra test is agc_driver_depth_plane_fill_discard. The 3 not counted were not built for those runs (agc_driver_stencil_plane_memory, guest_np_cpp_web_api_title_cloud_storage, guest_system_service_usb_storage); agc_driver_stencil_plane_memory was then built and passes 3 of 3 on the head with the same variables, 0 VUID-.
  • The stencil regression fails without the new line in DiscardFilledDepthPlanes: the stencil-only case with "a read of a stencil-only surface's plane stored nothing after another surface's depth plane was discarded", and, with that case removed, the same-surface case with "a read of the stencil plane stored nothing after its surface's depth plane was discarded".
  • tools/check_conventions.py --base origin/main: passes.
  • Linux (WSL, no Vulkan device): agc_driver_depth_plane_fill_discard_tests builds at 591da8f4df; the test skips 3 of 3 runs and fails with ANYPS5_REQUIRE_VULKAN=1, so its GPU paths did not run on Linux here.

Earlier results at aa144ce8f5 on main 6c7a3256f2:

  • ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R "depth|fill|storage" -V, 3 runs at aa144ce8f5: 80 of 81 pass each time, 0 VUID-, no missing-layer message. The failure is agc_driver_depth_plane_partial_store ("repeated lookups of the first layer of an unchanged array proved no refresh"), which fails the same way on main (c8d34aa8f4: 79 of 80, 0 VUID-). The extra test is agc_driver_depth_plane_fill_discard.
  • Full ctest at aa144ce8f5: 2305 tests; the failures are agc_driver_depth_plane_partial_store, agc_host_import_cut_lifetime (both fail the same way on main here) and select_tests (a temp-directory symlink error in tools/tests/test_select_tests.py).
  • tools/check_conventions.py --base origin/main: passes.

DEATHLOOP (PPSA01670), the beach at the start of the game (sprint and dodge tutorial), same machine and scripted input. main cannot reach this scene yet, so both builds are main + #10414 + #10507 + #10743 + a port of #6192, without (base d26dce2835) and with (change 88b55a05ee) this PR's first three commits. The last commit (aa144ce8f5) only keeps planes under fills that a multisample colour target absorbs, which DEATHLOOP's depth clears are not; it was not re-captured. Captures as the Performance report form says: APS5_TRACE_SECONDS=840:60 only, log not redirected, runs alternating base and change. The traces and the summary lines are assets of this release on my fork.

Run Build Presents in 60 s Frame p50 / p90 / p99 / max ms GPU busy per present ms Trace
1 base 337 178.0 / 183.9 / 190.8 / 196.8 53.3 run1
2 change 347 172.5 / 181.1 / 190.3 / 192.9 51.2 run2
3 base 344 174.3 / 179.0 / 187.5 / 191.0 53.3 run3
4 change 337 177.4 / 185.8 / 195.7 / 205.1 51.6 run4
5 base 337 177.9 / 183.2 / 190.1 / 193.7 53.0 run5
6 change 324 185.4 / 189.8 / 196.5 / 200.8 51.7 run6

The frame time does not change beyond run-to-run noise: this scene is CPU-bound. GPU busy per present is 1.3 to 2.1 ms lower in each change run than in the base runs.

Behaviour count, from separate runs with APS5_PROFILE_DRAW=1 (not the captures above): the [storage] lines report depth plane store write-backs of about 111 to 128 GiB per 330 s run on the title menus with the base build and none with the change. With temporary caller logging added locally (not in this PR), every one of those stores came from storeBufferFill (reason buffer fill) over the two 0x1fe0000-byte planes. The menus look the same with both builds.

aps5-summary.jsonl lines of the six runs, in run order
{"commit":"d26dce2835cb","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"840:60"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 9700X 8-Core Processor","cpu_threads":16,"memory_mib":31801,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"seconds 840:60","first_present":8614,"ms":60107.959},"presents":337,"frame_ms":{"p50":177.951,"p90":183.858,"p99":190.768,"max":196.822},"gpu_busy_ms_per_present":53.271,"worker_busy_pct":{"queue worker 0x0":99.227,"queue worker 0x20":97.824,"queue worker 0x28":97.385,"queue worker 0x38":99.93,"queue worker 0x30":99.658,"queue worker 0x40":99.965,"queue worker 0x48":99.983},"top_phases_ms_per_frame":{"Driver.Packet":1236.547,"Driver.Packet.memory_wait":1043.837,"Graphics.Draw":149.059,"Driver.Packet.draw":148.059,"Driver.Draw":147.73,"Graphics.Draw.draw_and_resource_release":141.774,"Driver.Draw.draw_enqueued":99.446,"Driver.Draw.shader_compile_and_link":28.86},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.279,"events_lost":934051,"totals_full":false},"draw committer":{"events_full_after_s":39.377,"events_lost":137976,"totals_full":false}},"trace":"aps5-trace-d26dce2835cb-41848.json.gz"}
{"commit":"88b55a05ee74","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"840:60"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 9700X 8-Core Processor","cpu_threads":16,"memory_mib":31801,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"seconds 840:60","first_present":9199,"ms":60122.777},"presents":347,"frame_ms":{"p50":172.474,"p90":181.063,"p99":190.306,"max":192.882},"gpu_busy_ms_per_present":51.182,"worker_busy_pct":{"queue worker 0x0":99.212,"queue worker 0x20":98.54,"queue worker 0x30":99.712,"queue worker 0x28":98.068,"queue worker 0x38":99.936,"queue worker 0x48":99.984,"queue worker 0x40":99.968},"top_phases_ms_per_frame":{"Driver.Packet":1203.588,"Driver.Packet.memory_wait":1017.453,"Graphics.Draw":145.698,"Driver.Packet.draw":145.165,"Driver.Draw":144.824,"Graphics.Draw.draw_and_resource_release":138.468,"Driver.Draw.draw_enqueued":96.263,"Driver.Draw.shader_compile_and_link":29.646},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":12.576,"events_lost":993452,"totals_full":false},"draw committer":{"events_full_after_s":38.232,"events_lost":150555,"totals_full":false}},"trace":"aps5-trace-88b55a05ee74-40768.json.gz"}
{"commit":"d26dce2835cb","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"840:60"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 9700X 8-Core Processor","cpu_threads":16,"memory_mib":31801,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"seconds 840:60","first_present":8973,"ms":60076.746},"presents":344,"frame_ms":{"p50":174.347,"p90":179.013,"p99":187.476,"max":191.038},"gpu_busy_ms_per_present":53.288,"worker_busy_pct":{"queue worker 0x0":99.205,"queue worker 0x28":97.381,"queue worker 0x30":99.651,"queue worker 0x20":97.842,"queue worker 0x40":99.965,"queue worker 0x48":99.982,"queue worker 0x38":99.908},"top_phases_ms_per_frame":{"Driver.Packet":1210.601,"Driver.Packet.memory_wait":1021.711,"Graphics.Draw":144.854,"Driver.Packet.draw":144.266,"Driver.Draw":143.92,"Graphics.Draw.draw_and_resource_release":137.657,"Driver.Draw.draw_enqueued":94.934,"Driver.Draw.shader_compile_and_link":29.998},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":12.617,"events_lost":985100,"totals_full":false},"draw committer":{"events_full_after_s":38.303,"events_lost":147991,"totals_full":false}},"trace":"aps5-trace-d26dce2835cb-24240.json.gz"}
{"commit":"88b55a05ee74","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"840:60"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 9700X 8-Core Processor","cpu_threads":16,"memory_mib":31801,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"seconds 840:60","first_present":8658,"ms":60020.4},"presents":337,"frame_ms":{"p50":177.364,"p90":185.819,"p99":195.727,"max":205.069},"gpu_busy_ms_per_present":51.611,"worker_busy_pct":{"queue worker 0x0":99.214,"queue worker 0x20":98.56,"queue worker 0x28":98.183,"queue worker 0x30":99.688,"queue worker 0x40":99.963,"queue worker 0x48":99.995,"queue worker 0x38":99.935},"top_phases_ms_per_frame":{"Driver.Packet":1237.63,"Driver.Packet.memory_wait":1047.644,"Graphics.Draw":150.447,"Driver.Packet.draw":149.521,"Driver.Draw":149.177,"Graphics.Draw.draw_and_resource_release":143.101,"Driver.Draw.draw_enqueued":100.166,"Driver.Draw.shader_compile_and_link":29.485},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":12.776,"events_lost":962266,"totals_full":false},"draw committer":{"events_full_after_s":39.102,"events_lost":139913,"totals_full":false}},"trace":"aps5-trace-88b55a05ee74-41120.json.gz"}
{"commit":"d26dce2835cb","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"840:60"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 9700X 8-Core Processor","cpu_threads":16,"memory_mib":31801,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"seconds 840:60","first_present":8701,"ms":60020.229},"presents":337,"frame_ms":{"p50":177.932,"p90":183.159,"p99":190.053,"max":193.682},"gpu_busy_ms_per_present":52.968,"worker_busy_pct":{"queue worker 0x0":99.224,"queue worker 0x28":97.481,"queue worker 0x20":97.968,"queue worker 0x38":99.933,"queue worker 0x30":99.664,"queue worker 0x40":99.964,"queue worker 0x48":99.983},"top_phases_ms_per_frame":{"Driver.Packet":1234.919,"Driver.Packet.memory_wait":1042.455,"Graphics.Draw":148.961,"Driver.Packet.draw":148.098,"Driver.Draw":147.758,"Graphics.Draw.draw_and_resource_release":141.741,"Driver.Draw.draw_enqueued":99.759,"Driver.Draw.shader_compile_and_link":28.798},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.197,"events_lost":939608,"totals_full":false},"draw committer":{"events_full_after_s":39.461,"events_lost":136938,"totals_full":false}},"trace":"aps5-trace-d26dce2835cb-37056.json.gz"}
{"commit":"88b55a05ee74","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"840:60"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 9700X 8-Core Processor","cpu_threads":16,"memory_mib":31801,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"seconds 840:60","first_present":8698,"ms":60148.507},"presents":324,"frame_ms":{"p50":185.446,"p90":189.83,"p99":196.519,"max":200.793},"gpu_busy_ms_per_present":51.722,"worker_busy_pct":{"queue worker 0x0":99.243,"queue worker 0x20":98.622,"queue worker 0x30":99.682,"queue worker 0x28":98.245,"queue worker 0x38":99.934,"queue worker 0x40":99.966,"queue worker 0x48":99.984},"top_phases_ms_per_frame":{"Driver.Packet":1290.156,"Driver.Packet.memory_wait":1092.058,"Graphics.Draw":157.561,"Driver.Packet.draw":156.59,"Driver.Draw":156.24,"Graphics.Draw.draw_and_resource_release":150.091,"Driver.Draw.draw_enqueued":107.474,"Driver.Draw.shader_compile_and_link":29.295},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.388,"events_lost":901172,"totals_full":false},"draw committer":{"events_full_after_s":40.808,"events_lost":124625,"totals_full":false}},"trace":"aps5-trace-88b55a05ee74-34860.json.gz"}

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: #1368, #9742 (merge order only); #13021 and #13023 (JAB-dev) add a declaration and a function on the DepthSurface.hpp and DepthSurface.cpp lines where this PR adds DiscardFilledDepthPlanes (merge order only); #9533 and #9717 have merged
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 616.64, Windows 11 Pro 26200
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5002658618 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10882). Originally posted by [orezraey](https://github.com/orezraey) on 2026-10-25T07:11:56Z. --- ### What A depth target drawn on the host leaves its plane stale: the results live in the host depth image and are stored to guest memory when something reads that memory. A uniform buffer fill over the whole plane (a depth clear done as a memory fill) is such a read: `storeBufferFill` calls `StorageTexture::FlushPending`, which calls `FlushDepthPlanes`, so the stale plane was stored in full, and the fill then overwrote every byte of it. DEATHLOOP (PPSA01670) clears two 3840x2160 D32 planes this way every frame, 32 MiB each. - `DiscardFilledDepthPlanes` (new, called by `storeBufferFill` for uniform fills before its flushes): a stale single-sample depth plane that the fill covers entirely, with a value `NoteDepthMetadataFill` would turn into a plane clear (a depth in 0..1, or a D16 pair; no HTILE fill over the target), drops its stale units instead of storing them and notes the plane clear itself (`NotePlaneFill`), so the host image is cleared to the filled value at its next use. Partial fills, fills of other values, planes that are syncing, and fills that a native multisample colour target absorbs (they never reach guest memory) are stored as before. - Rebuilding the stale-plane index keeps the ranges of pending stencil planes, as the rebuild in `FlushDepthPlanes` does, so a later read of a stencil plane still stores it after a fill discards a depth plane. `agc_driver_depth_plane_fill_discard` covers a stencil-only surface beside the discarded plane and a surface with both planes stale. - It notes the clear itself because the pipelined DMA fill path (`enqueueDmaPacket`) does not reach `preparePacketMemory`, so `NoteDepthMetadataFill` is not called for those fills. - `planeFillDepth` is the plane test both `NoteDepthMetadataFill` and the drop use, so they cannot disagree. - A fill that touches no stale plane returns after the existing `overlapsStalePlane` check, without the surfaces lock. - `agc_driver_depth_plane_fill_discard`: a stale 384x200 Z_X plane is kept by a shorter fill, a fill starting past it, a fill of -1.0 and a NaN fill; a fill of 1.0 around it drops it with no store counted, and a draw at 0.5 then passes LESS (the plane was cleared to 1.0) with no `NoteDepthMetadataFill` call; an exact fill drops it once; a fill of 0.0 makes the same draw fail LESS. It then calls `Driver::storeBufferFill` itself (through `DriverTestAccess`) with a fill of 0.75 over a stale plane: no store is counted, the plane holds 0.75, a draw at 0.5 passes LESS and a later read stores nothing. With the `storeBufferFill` call removed, that part fails with "the driver's fill of 0.75 over the whole stale plane stored the plane first". This PR makes no frame-time claim; see the captures below. ### Tested Windows 11 Pro 26200, AMD Ryzen 7 9700X, NVIDIA GeForce RTX 5070 Ti (driver 616.64), WinLibs GCC, Release. Head `591da8f4df`, which contains `main` `e67cc81869`. - `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R "depth|fill|storage|stencil" -V`, 3 runs at `591da8f4df` and 1 at `e67cc81869`: 99 of 102 pass each time on the head and 98 of 101 on `main`, 0 `VUID-` and no missing-layer message in any log. The extra test is `agc_driver_depth_plane_fill_discard`. The 3 not counted were not built for those runs (`agc_driver_stencil_plane_memory`, `guest_np_cpp_web_api_title_cloud_storage`, `guest_system_service_usb_storage`); `agc_driver_stencil_plane_memory` was then built and passes 3 of 3 on the head with the same variables, 0 `VUID-`. - The stencil regression fails without the new line in `DiscardFilledDepthPlanes`: the stencil-only case with "a read of a stencil-only surface's plane stored nothing after another surface's depth plane was discarded", and, with that case removed, the same-surface case with "a read of the stencil plane stored nothing after its surface's depth plane was discarded". - `tools/check_conventions.py --base origin/main`: passes. - Linux (WSL, no Vulkan device): `agc_driver_depth_plane_fill_discard_tests` builds at `591da8f4df`; the test skips 3 of 3 runs and fails with `ANYPS5_REQUIRE_VULKAN=1`, so its GPU paths did not run on Linux here. Earlier results at `aa144ce8f5` on `main` `6c7a3256f2`: - `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R "depth|fill|storage" -V`, 3 runs at `aa144ce8f5`: 80 of 81 pass each time, 0 `VUID-`, no missing-layer message. The failure is `agc_driver_depth_plane_partial_store` ("repeated lookups of the first layer of an unchanged array proved no refresh"), which fails the same way on `main` (`c8d34aa8f4`: 79 of 80, 0 `VUID-`). The extra test is `agc_driver_depth_plane_fill_discard`. - Full `ctest` at `aa144ce8f5`: 2305 tests; the failures are `agc_driver_depth_plane_partial_store`, `agc_host_import_cut_lifetime` (both fail the same way on `main` here) and `select_tests` (a temp-directory symlink error in `tools/tests/test_select_tests.py`). - `tools/check_conventions.py --base origin/main`: passes. **DEATHLOOP (PPSA01670)**, the beach at the start of the game (sprint and dodge tutorial), same machine and scripted input. `main` cannot reach this scene yet, so both builds are `main` + #10414 + #10507 + #10743 + a port of #6192, without (base `d26dce2835`) and with (change `88b55a05ee`) this PR's first three commits. The last commit (`aa144ce8f5`) only keeps planes under fills that a multisample colour target absorbs, which DEATHLOOP's depth clears are not; it was not re-captured. Captures as the Performance report form says: `APS5_TRACE_SECONDS=840:60` only, log not redirected, runs alternating base and change. The traces and the summary lines are assets of [this release on my fork](https://github.com/orezraey/AnyPS5/releases/tag/perf-depth-fill-e4c2098b48). | Run | Build | Presents in 60 s | Frame p50 / p90 / p99 / max ms | GPU busy per present ms | Trace | |---|---|---|---|---|---| | 1 | base | 337 | 178.0 / 183.9 / 190.8 / 196.8 | 53.3 | [run1](https://github.com/orezraey/AnyPS5/releases/download/perf-depth-fill-e4c2098b48/run1-base-aps5-trace-d26dce2835cb-41848.json.gz) | | 2 | change | 347 | 172.5 / 181.1 / 190.3 / 192.9 | 51.2 | [run2](https://github.com/orezraey/AnyPS5/releases/download/perf-depth-fill-e4c2098b48/run2-change-aps5-trace-88b55a05ee74-40768.json.gz) | | 3 | base | 344 | 174.3 / 179.0 / 187.5 / 191.0 | 53.3 | [run3](https://github.com/orezraey/AnyPS5/releases/download/perf-depth-fill-e4c2098b48/run3-base-aps5-trace-d26dce2835cb-24240.json.gz) | | 4 | change | 337 | 177.4 / 185.8 / 195.7 / 205.1 | 51.6 | [run4](https://github.com/orezraey/AnyPS5/releases/download/perf-depth-fill-e4c2098b48/run4-change-aps5-trace-88b55a05ee74-41120.json.gz) | | 5 | base | 337 | 177.9 / 183.2 / 190.1 / 193.7 | 53.0 | [run5](https://github.com/orezraey/AnyPS5/releases/download/perf-depth-fill-e4c2098b48/run5-base-aps5-trace-d26dce2835cb-37056.json.gz) | | 6 | change | 324 | 185.4 / 189.8 / 196.5 / 200.8 | 51.7 | [run6](https://github.com/orezraey/AnyPS5/releases/download/perf-depth-fill-e4c2098b48/run6-change-aps5-trace-88b55a05ee74-34860.json.gz) | The frame time does not change beyond run-to-run noise: this scene is CPU-bound. GPU busy per present is 1.3 to 2.1 ms lower in each change run than in the base runs. Behaviour count, from separate runs with `APS5_PROFILE_DRAW=1` (not the captures above): the `[storage]` lines report `depth plane store` write-backs of about 111 to 128 GiB per 330 s run on the title menus with the base build and none with the change. With temporary caller logging added locally (not in this PR), every one of those stores came from `storeBufferFill` (reason `buffer fill`) over the two 0x1fe0000-byte planes. The menus look the same with both builds. <details><summary><code>aps5-summary.jsonl</code> lines of the six runs, in run order</summary> ```json {"commit":"d26dce2835cb","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"840:60"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 9700X 8-Core Processor","cpu_threads":16,"memory_mib":31801,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"seconds 840:60","first_present":8614,"ms":60107.959},"presents":337,"frame_ms":{"p50":177.951,"p90":183.858,"p99":190.768,"max":196.822},"gpu_busy_ms_per_present":53.271,"worker_busy_pct":{"queue worker 0x0":99.227,"queue worker 0x20":97.824,"queue worker 0x28":97.385,"queue worker 0x38":99.93,"queue worker 0x30":99.658,"queue worker 0x40":99.965,"queue worker 0x48":99.983},"top_phases_ms_per_frame":{"Driver.Packet":1236.547,"Driver.Packet.memory_wait":1043.837,"Graphics.Draw":149.059,"Driver.Packet.draw":148.059,"Driver.Draw":147.73,"Graphics.Draw.draw_and_resource_release":141.774,"Driver.Draw.draw_enqueued":99.446,"Driver.Draw.shader_compile_and_link":28.86},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.279,"events_lost":934051,"totals_full":false},"draw committer":{"events_full_after_s":39.377,"events_lost":137976,"totals_full":false}},"trace":"aps5-trace-d26dce2835cb-41848.json.gz"} {"commit":"88b55a05ee74","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"840:60"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 9700X 8-Core Processor","cpu_threads":16,"memory_mib":31801,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"seconds 840:60","first_present":9199,"ms":60122.777},"presents":347,"frame_ms":{"p50":172.474,"p90":181.063,"p99":190.306,"max":192.882},"gpu_busy_ms_per_present":51.182,"worker_busy_pct":{"queue worker 0x0":99.212,"queue worker 0x20":98.54,"queue worker 0x30":99.712,"queue worker 0x28":98.068,"queue worker 0x38":99.936,"queue worker 0x48":99.984,"queue worker 0x40":99.968},"top_phases_ms_per_frame":{"Driver.Packet":1203.588,"Driver.Packet.memory_wait":1017.453,"Graphics.Draw":145.698,"Driver.Packet.draw":145.165,"Driver.Draw":144.824,"Graphics.Draw.draw_and_resource_release":138.468,"Driver.Draw.draw_enqueued":96.263,"Driver.Draw.shader_compile_and_link":29.646},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":12.576,"events_lost":993452,"totals_full":false},"draw committer":{"events_full_after_s":38.232,"events_lost":150555,"totals_full":false}},"trace":"aps5-trace-88b55a05ee74-40768.json.gz"} {"commit":"d26dce2835cb","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"840:60"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 9700X 8-Core Processor","cpu_threads":16,"memory_mib":31801,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"seconds 840:60","first_present":8973,"ms":60076.746},"presents":344,"frame_ms":{"p50":174.347,"p90":179.013,"p99":187.476,"max":191.038},"gpu_busy_ms_per_present":53.288,"worker_busy_pct":{"queue worker 0x0":99.205,"queue worker 0x28":97.381,"queue worker 0x30":99.651,"queue worker 0x20":97.842,"queue worker 0x40":99.965,"queue worker 0x48":99.982,"queue worker 0x38":99.908},"top_phases_ms_per_frame":{"Driver.Packet":1210.601,"Driver.Packet.memory_wait":1021.711,"Graphics.Draw":144.854,"Driver.Packet.draw":144.266,"Driver.Draw":143.92,"Graphics.Draw.draw_and_resource_release":137.657,"Driver.Draw.draw_enqueued":94.934,"Driver.Draw.shader_compile_and_link":29.998},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":12.617,"events_lost":985100,"totals_full":false},"draw committer":{"events_full_after_s":38.303,"events_lost":147991,"totals_full":false}},"trace":"aps5-trace-d26dce2835cb-24240.json.gz"} {"commit":"88b55a05ee74","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"840:60"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 9700X 8-Core Processor","cpu_threads":16,"memory_mib":31801,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"seconds 840:60","first_present":8658,"ms":60020.4},"presents":337,"frame_ms":{"p50":177.364,"p90":185.819,"p99":195.727,"max":205.069},"gpu_busy_ms_per_present":51.611,"worker_busy_pct":{"queue worker 0x0":99.214,"queue worker 0x20":98.56,"queue worker 0x28":98.183,"queue worker 0x30":99.688,"queue worker 0x40":99.963,"queue worker 0x48":99.995,"queue worker 0x38":99.935},"top_phases_ms_per_frame":{"Driver.Packet":1237.63,"Driver.Packet.memory_wait":1047.644,"Graphics.Draw":150.447,"Driver.Packet.draw":149.521,"Driver.Draw":149.177,"Graphics.Draw.draw_and_resource_release":143.101,"Driver.Draw.draw_enqueued":100.166,"Driver.Draw.shader_compile_and_link":29.485},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":12.776,"events_lost":962266,"totals_full":false},"draw committer":{"events_full_after_s":39.102,"events_lost":139913,"totals_full":false}},"trace":"aps5-trace-88b55a05ee74-41120.json.gz"} {"commit":"d26dce2835cb","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"840:60"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 9700X 8-Core Processor","cpu_threads":16,"memory_mib":31801,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"seconds 840:60","first_present":8701,"ms":60020.229},"presents":337,"frame_ms":{"p50":177.932,"p90":183.159,"p99":190.053,"max":193.682},"gpu_busy_ms_per_present":52.968,"worker_busy_pct":{"queue worker 0x0":99.224,"queue worker 0x28":97.481,"queue worker 0x20":97.968,"queue worker 0x38":99.933,"queue worker 0x30":99.664,"queue worker 0x40":99.964,"queue worker 0x48":99.983},"top_phases_ms_per_frame":{"Driver.Packet":1234.919,"Driver.Packet.memory_wait":1042.455,"Graphics.Draw":148.961,"Driver.Packet.draw":148.098,"Driver.Draw":147.758,"Graphics.Draw.draw_and_resource_release":141.741,"Driver.Draw.draw_enqueued":99.759,"Driver.Draw.shader_compile_and_link":28.798},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.197,"events_lost":939608,"totals_full":false},"draw committer":{"events_full_after_s":39.461,"events_lost":136938,"totals_full":false}},"trace":"aps5-trace-d26dce2835cb-37056.json.gz"} {"commit":"88b55a05ee74","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"840:60"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 9700X 8-Core Processor","cpu_threads":16,"memory_mib":31801,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"seconds 840:60","first_present":8698,"ms":60148.507},"presents":324,"frame_ms":{"p50":185.446,"p90":189.83,"p99":196.519,"max":200.793},"gpu_busy_ms_per_present":51.722,"worker_busy_pct":{"queue worker 0x0":99.243,"queue worker 0x20":98.622,"queue worker 0x30":99.682,"queue worker 0x28":98.245,"queue worker 0x38":99.934,"queue worker 0x40":99.966,"queue worker 0x48":99.984},"top_phases_ms_per_frame":{"Driver.Packet":1290.156,"Driver.Packet.memory_wait":1092.058,"Graphics.Draw":157.561,"Driver.Packet.draw":156.59,"Driver.Draw":156.24,"Graphics.Draw.draw_and_resource_release":150.091,"Driver.Draw.draw_enqueued":107.474,"Driver.Draw.shader_compile_and_link":29.295},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.388,"events_lost":901172,"totals_full":false},"draw committer":{"events_full_after_s":40.808,"events_lost":124625,"totals_full":false}},"trace":"aps5-trace-88b55a05ee74-34860.json.gz"} ``` </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: #1368, #9742 (merge order only); #13021 and #13023 (JAB-dev) add a declaration and a function on the `DepthSurface.hpp` and `DepthSurface.cpp` lines where this PR adds `DiscardFilledDepthPlanes` (merge order only); #9533 and #9717 have merged - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 616.64, Windows 11 Pro 26200 - [x] AI-assisted: yes
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!10882
No description provided.