Skip to content

fix(driver): bound transient texture upload copies within one draw or dispatch - #1180

Closed
MichonGoddijn231849 wants to merge 1 commit into
boykopovar:mainfrom
MichonGoddijn231849:fix/transient-upload-bound
Closed

MichonGoddijn231849 wants to merge 1 commit into
boykopovar:mainfrom
MichonGoddijn231849:fix/transient-upload-bound

Conversation

@MichonGoddijn231849

Copy link
Copy Markdown
Contributor

What

A texture upload recorded into the open batch keeps its host staging copy and its device tiled and linear copies until the batch completes. The finished batch's objects are destroyed only when the hold ends. So a dispatch that creates a thousand bindless table textures held about three times the textures' bytes in copies, and ran out of device memory.

The copies are now kept through Recorder::KeepTransient, which counts their bytes while they live. When the live bytes exceed APS5_UPLOAD_BUDGET_MIB (default 1024), the image lookups of a build settle: the recorded work is submitted and waited for, and the finished batches' objects are destroyed at once. Builds under the budget are unchanged.

Tested

Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB, MinGW-w64 GCC 15.2.0.

  • GTA V PPSA04264 (01.005) runs with this change on the combined gta-v/testing branch (Performance mode, the prologue).
  • On this branch: builds, and ctest passes. Not run here: the relinker's Python tests (my local Python does not find their helper modules) and guest_gameupdate.

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 (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
  • AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it.

🤖 Generated with Claude Code

… dispatch

A texture upload recorded into the open batch keeps its host staging copy
and its device tiled and linear copies until the batch completes, and the
finished batch's objects are destroyed only when the hold ends. A dispatch
that creates a thousand bindless table textures therefore held about three
times the textures' bytes in copies and ran out of device memory.

The copies are now kept through Recorder::KeepTransient, which counts their
bytes while they live. When the live bytes exceed APS5_UPLOAD_BUDGET_MIB
(default 1024), the image lookups of a build settle: the recorded work is
submitted and waited for and the finished batches' objects are destroyed at
once. Builds under the budget are unchanged. APS5_TRACE_BINDLESS now also
reports a table's distinct T#s and surfaces.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 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
#1364 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp L96-103
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp L2193-2240
#1366 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp L96-103
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp L2193-2240

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: #1113 bounds the same upload copies a recorder batch keeps alive, was opened first, and has a test and the out-of-memory line. If it doesn't cover what GTA V hits, please comment on #1113 with what it misses.

@MichonGoddijn231849
MichonGoddijn231849 deleted the fix/transient-upload-bound branch October 9, 2026 20:06
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