fix(agc): release shader modules after pipeline creation #2284

Merged
eljackjoestar-cmd merged 1 commit from upstream-pr/2284 into main 2026-10-10 04:46:33 +00:00
eljackjoestar-cmd commented 2026-10-09 14:32:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by eljackjoestar-cmd on 2026-10-09T14:32:35Z.


What

Successful compute and graphics pipeline creation currently keeps shader modules until the cached pipeline objects are destroyed. Release these modules immediately after creation and clear their handles so teardown cannot destroy them twice. Failed creation still uses the existing cleanup path; pipeline, layout, cache and recorded-command lifetimes remain intact.

This follows vkDestroyShaderModule: pipelines can continue using their shaders after the module is destroyed. No shader instruction semantics change.

Tested

Windows x86-64, WinLibs GCC 15.2.0, NVIDIA GeForce RTX 5070. Fresh Release build of all, libs and the recorder target with SPIR-V validation enabled. Full CTest run with Vulkan required and a fresh shader-cache directory: 509 passed, 1 pre-existing no-surface display/Vulkan skip, 0 failures (160.13 s). This executes the existing compute and graphics homebrew fixtures after module destruction. No isolated game FPS or memory improvement is claimed.

python tools/check_conventions.py --base origin/main and git diff --check pass. One unchanged Windows dependency-diagnostics test took 31.84 s on its first run; no test or timeout is changed by this PR. Linux/lavapipe and the collaborator-triggered full CI workflow have not been run locally.

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 in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4801841287 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2284). Originally posted by [eljackjoestar-cmd](https://github.com/eljackjoestar-cmd) on 2026-10-09T14:32:35Z. --- ### What Successful compute and graphics pipeline creation currently keeps shader modules until the cached pipeline objects are destroyed. Release these modules immediately after creation and clear their handles so teardown cannot destroy them twice. Failed creation still uses the existing cleanup path; pipeline, layout, cache and recorded-command lifetimes remain intact. This follows [vkDestroyShaderModule](https://docs.vulkan.org/refpages/latest/refpages/source/vkDestroyShaderModule.html): pipelines can continue using their shaders after the module is destroyed. No shader instruction semantics change. ### Tested Windows x86-64, WinLibs GCC 15.2.0, NVIDIA GeForce RTX 5070. Fresh Release build of `all`, `libs` and the recorder target with SPIR-V validation enabled. Full CTest run with Vulkan required and a fresh shader-cache directory: 509 passed, 1 pre-existing no-surface display/Vulkan skip, 0 failures (160.13 s). This executes the existing compute and graphics homebrew fixtures after module destruction. No isolated game FPS or memory improvement is claimed. `python tools/check_conventions.py --base origin/main` and `git diff --check` pass. One unchanged Windows dependency-diagnostics test took 31.84 s on its first run; no test or timeout is changed by this PR. Linux/lavapipe and the collaborator-triggered full CI workflow have not been run locally. ### Checklist - [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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
MarcZX10 commented 2026-10-09 14:39:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T14:39:08Z.


I reviewed the complete two-file diff. Destroying each module after successful pipeline creation is consistent with Vulkan’s module lifetime rule, and the existing cleanup remains active on creation failures. The Windows full build and CTest report plus the automatic relinker matrix are useful evidence. The remaining verification gap is Linux/lavapipe: this AGC system-library change has no Linux full build/CTest report, and the PR’s manual Linux job is skipped. Please add an exact-head Linux result or have a collaborator run Actions → Build before approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6083123095 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2284#issuecomment-6083123095). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T14:39:08Z. --- I reviewed the complete two-file diff. Destroying each module after successful pipeline creation is consistent with Vulkan’s module lifetime rule, and the existing cleanup remains active on creation failures. The Windows full build and CTest report plus the automatic relinker matrix are useful evidence. The remaining verification gap is Linux/lavapipe: this AGC system-library change has no Linux full build/CTest report, and the PR’s manual Linux job is skipped. Please add an exact-head Linux result or have a collaborator run Actions → Build before approval.
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!2284
No description provided.