refactor(agc): create, bind and free buffers through the device function table #11920

Merged
milescoviello merged 4 commits from upstream-pr/11920 into main 2026-11-13 10:16:09 +00:00
milescoviello commented 2026-10-27 12:34:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-27T12:34:22Z.


What

Follow-up to #10764, as agreed with oneandonlydean there (comment). BiladeiroSupremo's lookup cache (BiladeiroSupremo/AnyPS5Wolverine@fccc2547a) gets a home in the resolved device-function table, not a separate per-thread cache. BiladeiroSupremo is credited with a Co-authored-by trailer.

Graphics::Context::Function looks a Vulkan device function up by name, through the loader and every implicit layer, on each call. #10764 moved the texture detiler onto Context::Resolved. That reads DeviceFunctions and falls back to Function only while the table is absent or lacks the entry.

I counted lookups by name in Call of Duty: Black Ops II (PPSA34502 01.010.000, 300 s of campaign gameplay). The build was main plus #10764 and #9656 plus a local counter (not in this PR). It made 2.1 million lookups by name, and four buffer calls account for 1.9 million of them:

Function Lookups
vkCreateBuffer 485,014
vkBindBufferMemory 485,013
vkGetBufferMemoryRequirements 485,013
vkDestroyBuffer 459,796
vkCmdPipelineBarrier 38,262
vkMapMemory 18,606
vkCreateImageView / vkDestroyImageView 8,731 / 6,677
vkResetDescriptorPool, fence calls, submit, command buffer begin/end/reset, framebuffers 3,000–7,500 each

They come from ShaderResources::addDataBuffer → Buffer::Buffer → BindExactBuffer: a pooled buffer rebound at a new exact size for a draw's data.

This PR:

  • adds createBuffer, destroyBuffer, getBufferMemoryRequirements, bindBufferMemory, allocateMemory, freeMemory, mapMemory and unmapMemory to DeviceFunctions and to FillDeviceFunctions;
  • resolves those calls through the table in BindExactBuffer, Buffer::Buffer, Buffer::release, DeviceBuffer::DeviceBuffer, DeviceBuffer::release, BufferPool's constructor and MemoryAccounting::Allocate / Free. The one vkGetFenceStatus call in CommandBatch::~CommandBatch also uses the table entry it already had.

Every other Function call site stays as it is. An earlier version of this PR converted 366 call sites in 23 files. CnRJay pointed out that the counts above put the saving in these few, so the rest is out.

How

Resolved returns the table entry when the device has filled its table, and otherwise calls Function as before. So contexts without a table (mocks, APS5_NO_PROC_TABLE, calls made before the table is filled) behave exactly as on main. The table is filled once at device creation and only read afterwards.

Tests, in agc_buffer_pool:

  • TableFill fills a table through FillDeviceFunctions from a mock vkGetDeviceProcAddr. It checks that each of the 8 new members holds the mock function of the name it is filled from, so a member filled from the wrong name fails.
  • TableLookups: the mock counts lookups by name. A cycle of a host-visible Buffer and a DeviceBuffer at sizes the pool hasn't seen forces the exact-size rebind path. Without a table the cycle must look something up, so the counter sees these calls. With a table holding the buffer and memory functions, a second cycle must make no lookup.

Tested

At head 860450ba7f (rebased onto main abe492bfea), same machine: a full cmake --build build succeeds, and the 15 tests matching BufferPool|buffer_pool|memory_accounting|device_functions|pipeline_cache_alloc pass.

Earlier, Linux (Ubuntu 26.04.1, GCC 15.2), RTX 4070 Ti (NVIDIA 615.71.09), at head 8b7a2ae407:

  • Merged with main 5bae1a4bc2 (bfb5e10bbc, clean): a full cmake --build build of every target succeeds, and the 8 tests in the next item pass on the merge too.
  • agc_buffer_pool (3 entries), agc_memory_accounting, agc_memory_accounting_budget_cap, agc_memory_accounting_budget_floor and agc_deferred_memory_accounting pass, 8 of 8 in each of 3 runs.
  • Khronos validation layer (1.4.363), same 8 tests, main-side base 52ca9f0137 (#10764 alone) against this head: 8 of 8 pass on both, one Vulkan device created on each, no validation IDs on either.
    • Re-run 11-09 on layer 1.4.341 with VK_LOADER_DEBUG=layer: merge base 13b19a1dca vs head 7ed8fb0434, with agc_buffer_pool, the agc_memory_accounting* tests and the agc_driver_image_memory* execution tests this PR touches. 13 of 13 pass on both sides, the loader inserted the layer for each of the 8 Vulkan devices per side, and there are no VUIDs. It replaces the 1.4.363 run above, whose layer load can't be confirmed (#17896).

Windows 11 VM (GeForce GT 1030, WinLibs GCC, Release), agc_buffer_pool, agc_memory_accounting* and agc_deferred_memory_accounting: 8 of 8 in each of 3 runs, on this head and on main 0e9dc7bc4c.

Red control for TableFill: this head with destroyBuffer filled from "vkDestroyBufferView" (35e1d136a0, branch test/11920-fill-mutant on my fork) fails agc_buffer_pool in all 3 runs on the VM: the device function table's member for vkDestroyBuffer was not filled from that name.

I haven't re-measured CPU time for this narrowed commit, and I don't claim a frame-time change.

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: #15440 (it takes libSceAgcDriver off agc_pipeline_cache_allocation_tests's link line; this PR rebases onto it)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA RTX 4070 Ti (Linux, 615.71.09), GeForce GT 1030 (Windows 11 VM)
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5033973539 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11920). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-27T12:34:22Z. --- ### What Follow-up to #10764, as agreed with oneandonlydean there ([comment](https://github.com/boykopovar/AnyPS5/pull/10764#issuecomment-6438760449)). BiladeiroSupremo's lookup cache (BiladeiroSupremo/AnyPS5Wolverine@fccc2547a) gets a home in the resolved device-function table, not a separate per-thread cache. BiladeiroSupremo is credited with a `Co-authored-by` trailer. `Graphics::Context::Function` looks a Vulkan device function up by name, through the loader and every implicit layer, on each call. #10764 moved the texture detiler onto `Context::Resolved`. That reads `DeviceFunctions` and falls back to `Function` only while the table is absent or lacks the entry. I counted lookups by name in Call of Duty: Black Ops II (PPSA34502 01.010.000, 300 s of campaign gameplay). The build was `main` plus #10764 and #9656 plus a local counter (not in this PR). It made 2.1 million lookups by name, and four buffer calls account for 1.9 million of them: | Function | Lookups | |---|---| | `vkCreateBuffer` | 485,014 | | `vkBindBufferMemory` | 485,013 | | `vkGetBufferMemoryRequirements` | 485,013 | | `vkDestroyBuffer` | 459,796 | | `vkCmdPipelineBarrier` | 38,262 | | `vkMapMemory` | 18,606 | | `vkCreateImageView` / `vkDestroyImageView` | 8,731 / 6,677 | | `vkResetDescriptorPool`, fence calls, submit, command buffer begin/end/reset, framebuffers | 3,000–7,500 each | They come from `ShaderResources::addDataBuffer` → `Buffer::Buffer` → `BindExactBuffer`: a pooled buffer rebound at a new exact size for a draw's data. This PR: - adds `createBuffer`, `destroyBuffer`, `getBufferMemoryRequirements`, `bindBufferMemory`, `allocateMemory`, `freeMemory`, `mapMemory` and `unmapMemory` to `DeviceFunctions` and to `FillDeviceFunctions`; - resolves those calls through the table in `BindExactBuffer`, `Buffer::Buffer`, `Buffer::release`, `DeviceBuffer::DeviceBuffer`, `DeviceBuffer::release`, `BufferPool`'s constructor and `MemoryAccounting::Allocate` / `Free`. The one `vkGetFenceStatus` call in `CommandBatch::~CommandBatch` also uses the table entry it already had. Every other `Function` call site stays as it is. An earlier version of this PR converted 366 call sites in 23 files. CnRJay pointed out that the counts above put the saving in these few, so the rest is out. ### How `Resolved` returns the table entry when the device has filled its table, and otherwise calls `Function` as before. So contexts without a table (mocks, `APS5_NO_PROC_TABLE`, calls made before the table is filled) behave exactly as on `main`. The table is filled once at device creation and only read afterwards. **Tests**, in `agc_buffer_pool`: - `TableFill` fills a table through `FillDeviceFunctions` from a mock `vkGetDeviceProcAddr`. It checks that each of the 8 new members holds the mock function of the name it is filled from, so a member filled from the wrong name fails. - `TableLookups`: the mock counts lookups by name. A cycle of a host-visible `Buffer` and a `DeviceBuffer` at sizes the pool hasn't seen forces the exact-size rebind path. Without a table the cycle must look something up, so the counter sees these calls. With a table holding the buffer and memory functions, a second cycle must make no lookup. ### Tested **At head `860450ba7f`** (rebased onto `main` `abe492bfea`), same machine: a full `cmake --build build` succeeds, and the 15 tests matching `BufferPool|buffer_pool|memory_accounting|device_functions|pipeline_cache_alloc` pass. Earlier, Linux (Ubuntu 26.04.1, GCC 15.2), RTX 4070 Ti (NVIDIA 615.71.09), at head `8b7a2ae407`: - Merged with `main` `5bae1a4bc2` (`bfb5e10bbc`, clean): a full `cmake --build build` of every target succeeds, and the 8 tests in the next item pass on the merge too. - `agc_buffer_pool` (3 entries), `agc_memory_accounting`, `agc_memory_accounting_budget_cap`, `agc_memory_accounting_budget_floor` and `agc_deferred_memory_accounting` pass, 8 of 8 in each of 3 runs. - Khronos validation layer (1.4.363), same 8 tests, `main`-side base `52ca9f0137` (#10764 alone) against this head: 8 of 8 pass on both, one Vulkan device created on each, no validation IDs on either. - **Re-run 11-09** on layer 1.4.341 with `VK_LOADER_DEBUG=layer`: merge base `13b19a1dca` vs head `7ed8fb0434`, with `agc_buffer_pool`, the `agc_memory_accounting*` tests and the `agc_driver_image_memory*` execution tests this PR touches. 13 of 13 pass on both sides, the loader inserted the layer for each of the 8 Vulkan devices per side, and there are no VUIDs. It replaces the 1.4.363 run above, whose layer load can't be confirmed (#17896). Windows 11 VM (GeForce GT 1030, WinLibs GCC, Release), `agc_buffer_pool`, `agc_memory_accounting*` and `agc_deferred_memory_accounting`: 8 of 8 in each of 3 runs, on this head and on `main` `0e9dc7bc4c`. Red control for `TableFill`: this head with `destroyBuffer` filled from `"vkDestroyBufferView"` (`35e1d136a0`, branch `test/11920-fill-mutant` on my fork) fails `agc_buffer_pool` in all 3 runs on the VM: `the device function table's member for vkDestroyBuffer was not filled from that name`. I haven't re-measured CPU time for this narrowed commit, and I don't claim a frame-time change. ### 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: #15440 (it takes `libSceAgcDriver` off `agc_pipeline_cache_allocation_tests`'s link line; this PR rebases onto it) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA RTX 4070 Ti (Linux, 615.71.09), GeForce GT 1030 (Windows 11 VM) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
CnRJay commented 2026-11-01 19:49:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:49:25Z.

Review: COMMENTED


1. Speed claim without trace_digest. The title is perf(agc), and the evidence is an env-gated timer around vkGetDeviceProcAddr (96a3a18601, not in this PR): 846-868 ms before and 48-50 ms after, per 300 s run. That is about 0.8 s of CPU in 300 s, roughly 0.27% of one core, or about 100 ns per lookup, and it is not the metric the project accepts. Please post tools/trace_digest.py summaries of main and of this branch on the same machine and scene. If frame p50/p99 do not move, this is a cleanup and should be described as one.

2. The win is three call sites; the diff is 366. The lookup table in the description shows vkCreateBuffer, vkBindBufferMemory, vkGetBufferMemoryRequirements and vkDestroyBuffer at about 485k each, with everything else at 3,000-7,500 per 300 s (10-25 per second). Adding the buffer and memory entries to DeviceFunctions and converting Buffer::Buffer / BindExactBuffer would capture essentially all of it. Converting the per-present, overlay and framebuffer calls across 23 files buys nothing measurable and, by the author's own account, conflicted with main in 8 files on the last rebase. Please split it, or justify the rest with numbers.

3. Carries #10764. The branch is #10764 rebased plus this commit, so the diff here includes another open PR. Please state the merge order or retarget so only this commit is reviewed.

4. Fallback in Resolved. When the table lacks an entry it silently falls back to Function. With 19 new members and 366 converted sites, a typo in a member/name pair (&DeviceFunctions::x, "vkY") resolves to the wrong function with no compile error. A test that checks every converted pair against the name it was filled from would catch that; TableLookups only covers the buffer calls.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729922169 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11920#pullrequestreview-5729922169). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:49:25Z. **Review:** COMMENTED --- **1. Speed claim without `trace_digest`.** The title is `perf(agc)`, and the evidence is an env-gated timer around `vkGetDeviceProcAddr` (`96a3a18601`, not in this PR): 846-868 ms before and 48-50 ms after, per 300 s run. That is about 0.8 s of CPU in 300 s, roughly 0.27% of one core, or about 100 ns per lookup, and it is not the metric the project accepts. Please post `tools/trace_digest.py` summaries of main and of this branch on the same machine and scene. If frame p50/p99 do not move, this is a cleanup and should be described as one. **2. The win is three call sites; the diff is 366.** The lookup table in the description shows `vkCreateBuffer`, `vkBindBufferMemory`, `vkGetBufferMemoryRequirements` and `vkDestroyBuffer` at about 485k each, with everything else at 3,000-7,500 per 300 s (10-25 per second). Adding the buffer and memory entries to `DeviceFunctions` and converting `Buffer::Buffer` / `BindExactBuffer` would capture essentially all of it. Converting the per-present, overlay and framebuffer calls across 23 files buys nothing measurable and, by the author's own account, conflicted with main in 8 files on the last rebase. Please split it, or justify the rest with numbers. **3. Carries #10764.** The branch is #10764 rebased plus this commit, so the diff here includes another open PR. Please state the merge order or retarget so only this commit is reviewed. **4. Fallback in `Resolved`.** When the table lacks an entry it silently falls back to `Function`. With 19 new members and 366 converted sites, a typo in a member/name pair (`&DeviceFunctions::x, "vkY"`) resolves to the wrong function with no compile error. A test that checks every converted pair against the name it was filled from would catch that; `TableLookups` only covers the buffer calls.
XairRrR commented 2026-11-03 12:46:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T12:46:58Z.

Review: APPROVED


Reviewed — approved

The PR adds 8 buffer and memory entries to DeviceFunctions and resolves the hot Buffer / DeviceBuffer / BindExactBuffer calls through the table; it merges cleanly, builds, passes, and its new tests catch the regressions they target.

What I ran

Head 860450ba7f34b65cf1353d529ac8ef7b37c3dccd, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 9bbbb24811667ede59329e345f4fb4613bdba579 (Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe / Mesa 26.1.6).

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...860450ba7f34b65cf1353d529ac8ef7b37c3dccd
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "agc_buffer_pool|memory_accounting"
# negative controls (see below), each followed by
ninja -C build -j32 -l32
ctest --test-dir build --output-on-failure -R "^agc_buffer_pool$"
git status --porcelain

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Build (script, merged tree) ok
Selected tests (script) 2157 ran, 2036 passed, 114 expected skips, 0 new failures, 0 timeouts; 7 known failures that also fail on main
Vulkan validation (script, main vs merge) 770 tests, layer loaded in 769, none missing, 0 tests with new VUIDs
agc_buffer_pool*, agc_*memory_accounting*, agc_deferred_memory_accounting 8/8 passed
Worktree after controls back to the merged tree (git status --porcelain empty), agc_buffer_pool passes again

Negative control

  1. I restored Resources.cpp, BufferPool.cpp and MemoryAccounting.cpp from main and kept the merged Context.hpp so the test still compiles. agc_buffer_pool failed in TableFill:

    output
    FAIL: the device function table's member for vkCreateBuffer was not filled from that name
    FAIL: the device function table's member for vkDestroyBuffer was not filled from that name
    
  2. I kept the merged Resources.cpp (which has the table fill) and changed only its 4 bindBufferMemory call sites back to context.Function<PFN_vkBindBufferMemory>. TableLookups failed:

    output
    FAIL: a host and a device buffer cycle of new sizes looked up 4 Vulkan functions by name while the device's function table holds them
    
  3. I restored only BufferPool.cpp and MemoryAccounting.cpp from main. The test passed (see the non-blocking note below).

I then restored the merged files, rebuilt, and confirmed the worktree is clean and the test passes.

Findings

Blocking

None.

Non-blocking

  • The MemoryAccounting and BufferPool-constructor conversions have no test coverage. core/libs/prx/libSceAgcDriver/Graphics/src/MemoryAccounting.cpp:54 and :74 and the BufferPool constructor (core/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp:43) can be reverted without failing TableLookups (control 3). The pool's own allocations go through the members it captured once in its constructor, so the cycle never reaches MemoryAccounting::Allocate/Free(context, …) through the table. This doesn't affect correctness: TableFill checks that the members are filled from the right names. But the description reads as if TableLookups covers these sites. I suggest narrowing that wording, or extending the cycle to cover a non-pooled allocate/free.
  • IsDeferredMemoryFree still sees the same pointer after the change. I checked this because MemoryAccounting::Free compares the free function against deferredFreeMemory (core/libs/prx/libSceAgcDriver/Graphics/src/MemoryAccounting.cpp:60). VulkanDevice installs DeferDestructionToIdle's resolver (core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp:2312) before FillDeviceFunctions runs (:2372). The table therefore holds the same deferring vkFreeMemory/vkDestroyBuffer that Function would return, so the pointer check behaves as on main. No action needed. I'm noting it because a future reorder of those two lines would break this silently.
  • The checklist's dependency doesn't match the diff. The Depends on: #15440 line describes a link-line change, but the current diff no longer touches tests/cmake/agc_pipeline_cache_allocation_tests.cmake. The PR merges and builds on main without #15440, so the dependency now looks like merge order only. Saying so would help the maintainer. The merge-order agreement with #13796 that the author mentioned in the discussion is also not on the current Depends-on line.

Not verified

  • No hardware GPU: I ran nothing on NVIDIA or AMD. The validation comparison is the script's lavapipe run.
  • I did not measure the lookup or CPU-time savings. The PR no longer claims a speed change.
  • Windows/MinGW build.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5752382254 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11920#pullrequestreview-5752382254). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T12:46:58Z. **Review:** APPROVED --- # Reviewed — approved The PR adds 8 buffer and memory entries to `DeviceFunctions` and resolves the hot `Buffer` / `DeviceBuffer` / `BindExactBuffer` calls through the table; it merges cleanly, builds, passes, and its new tests catch the regressions they target. ## What I ran Head `860450ba7f34b65cf1353d529ac8ef7b37c3dccd`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged tree `9bbbb24811667ede59329e345f4fb4613bdba579` (Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe / Mesa 26.1.6). ``` git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...860450ba7f34b65cf1353d529ac8ef7b37c3dccd python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "agc_buffer_pool|memory_accounting" # negative controls (see below), each followed by ninja -C build -j32 -l32 ctest --test-dir build --output-on-failure -R "^agc_buffer_pool$" git status --porcelain ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Build (script, merged tree) | ok | | Selected tests (script) | 2157 ran, 2036 passed, 114 expected skips, 0 new failures, 0 timeouts; 7 known failures that also fail on `main` | | Vulkan validation (script, `main` vs merge) | 770 tests, layer loaded in 769, none missing, 0 tests with new VUIDs | | `agc_buffer_pool*`, `agc_*memory_accounting*`, `agc_deferred_memory_accounting` | 8/8 passed | | Worktree after controls | back to the merged tree (`git status --porcelain` empty), `agc_buffer_pool` passes again | ## Negative control 1. I restored `Resources.cpp`, `BufferPool.cpp` and `MemoryAccounting.cpp` from `main` and kept the merged `Context.hpp` so the test still compiles. `agc_buffer_pool` failed in `TableFill`: <details><summary>output</summary> ``` FAIL: the device function table's member for vkCreateBuffer was not filled from that name FAIL: the device function table's member for vkDestroyBuffer was not filled from that name ``` </details> 2. I kept the merged `Resources.cpp` (which has the table fill) and changed only its 4 `bindBufferMemory` call sites back to `context.Function<PFN_vkBindBufferMemory>`. `TableLookups` failed: <details><summary>output</summary> ``` FAIL: a host and a device buffer cycle of new sizes looked up 4 Vulkan functions by name while the device's function table holds them ``` </details> 3. I restored only `BufferPool.cpp` and `MemoryAccounting.cpp` from `main`. The test **passed** (see the non-blocking note below). I then restored the merged files, rebuilt, and confirmed the worktree is clean and the test passes. ## Findings ### Blocking None. ### Non-blocking - **The `MemoryAccounting` and `BufferPool`-constructor conversions have no test coverage.** `core/libs/prx/libSceAgcDriver/Graphics/src/MemoryAccounting.cpp:54` and `:74` and the `BufferPool` constructor (`core/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp:43`) can be reverted without failing `TableLookups` (control 3). The pool's own allocations go through the members it captured once in its constructor, so the cycle never reaches `MemoryAccounting::Allocate`/`Free(context, …)` through the table. This doesn't affect correctness: `TableFill` checks that the members are filled from the right names. But the description reads as if `TableLookups` covers these sites. I suggest narrowing that wording, or extending the cycle to cover a non-pooled allocate/free. - **`IsDeferredMemoryFree` still sees the same pointer after the change.** I checked this because `MemoryAccounting::Free` compares the free function against `deferredFreeMemory` (`core/libs/prx/libSceAgcDriver/Graphics/src/MemoryAccounting.cpp:60`). `VulkanDevice` installs `DeferDestructionToIdle`'s resolver (`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp:2312`) before `FillDeviceFunctions` runs (`:2372`). The table therefore holds the same deferring `vkFreeMemory`/`vkDestroyBuffer` that `Function` would return, so the pointer check behaves as on `main`. No action needed. I'm noting it because a future reorder of those two lines would break this silently. - **The checklist's dependency doesn't match the diff.** The `Depends on: #15440` line describes a link-line change, but the current diff no longer touches `tests/cmake/agc_pipeline_cache_allocation_tests.cmake`. The PR merges and builds on `main` without #15440, so the dependency now looks like merge order only. Saying so would help the maintainer. The merge-order agreement with #13796 that the author mentioned in the discussion is also not on the current Depends-on line. ## Not verified - No hardware GPU: I ran nothing on NVIDIA or AMD. The validation comparison is the script's lavapipe run. - I did not measure the lookup or CPU-time savings. The PR no longer claims a speed change. - Windows/MinGW build. <!-- anyps5-bots job=2060 head=860450ba7f34b65cf1353d529ac8ef7b37c3dccd -->
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!11920
No description provided.