Skip to content

fix(libSceAgcDriver): destroy host imports of a replaced Vulkan device - #284

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
SP4C3B4R-8:fix/replaced-device-host-imports
Oct 4, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
SP4C3B4R-8:fix/replaced-device-host-imports

Conversation

@SP4C3B4R-8

Copy link
Copy Markdown
Contributor

What

When the headless Vulkan device is replaced by the windowed one, the host import registry was cleared without destroying the imported buffers and memory. The replaced device is kept alive in Driver::replacedDevices, so all imported pinned host memory stayed allocated, and the new device failed with VK_ERROR_OUT_OF_DEVICE_MEMORY when importing the same ranges again (several GiB in a large title). The registry now keeps the destroy functions of its device and frees the imports on replacement.

Tested

Windows 11, MinGW-w64 GCC 15.2.0 (winlibs, ucrt posix seh). Full build and ctest: 95/95 passed on this branch alone. Also checked with a retail title.

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
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes (Claude). I reviewed and take responsibility for every line.

🤖 Generated with Claude Code

Replacing the headless device with the windowed one dropped the import
registry without freeing its buffers and memory, and the replaced device
is kept alive, so the imported pinned host memory stayed allocated and
the new device ran out of memory importing the same ranges again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the agc libSceAgc* label Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#290 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp L365, L367-368, L370-371
#291 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp L365, L367-368, L370-371
#426 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp L365, L367-368, L370-371

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants