Skip to content

fix(agc): allocate oversized descriptor sets from a dedicated pool - #1266

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
Celegans12:fix/agc-oversized-descriptor-sets
Oct 8, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
Celegans12:fix/agc-oversized-descriptor-sets

Conversation

@Celegans12

Copy link
Copy Markdown
Contributor

What

DescriptorCache::Allocate returns no set when a set needs more descriptors of one type than a chain pool holds (4,096 storage buffers, 1,024 sampled or storage images, 512 samplers). A build's own set falls back to a pool of its own, but PrepareDrawBindings has none and throws draw snapshot descriptor allocation failed, so the draw is skipped.

Tested

  • Windows 11, MinGW-w64 GCC 15.2.0, based on main c5e1018: configure -DBUILD_TESTING=ON, full build, --target libs, ctest:
  • 396/396 tests pass (ctest --output-on-failure)
  • Same build on lavapipe (Mesa 26.2.4 llvmpipe, 8-wide subgroups, VK_DRIVER_FILES): 395/395 pass; agc_driver_flat_store is left out there because it takes several minutes on Windows llvmpipe
  • New agc_driver_oversized_descriptor_sets (GPU): two 4,097-buffer sets get a pool each and a dispatch reads through one. Fails on main.
  • agc_driver_graphics: dedicated pool sizes, flags and Free, chain-sized sets, limit and type checks. Fails on main.
  • PPSA26344 v1.008: a 2,700 s run with this change has no draw snapshot descriptor allocation failed skips (409 without it); it made 628 dedicated pools, and the DRAW_INDIRECT into 0x5063bf0000 bound 16,386 sampled images and was recorded.
  • Not tested: Linux (CI), console behaviour.

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

DescriptorCache::Allocate returned no set when a set needed more
descriptors of one type than a chain pool holds (4,096 storage
buffers, 1,024 sampled or storage images, 512 samplers). A build's
own set then fell back to a pool of its own, but PrepareDrawBindings
has no fallback and threw "draw snapshot descriptor allocation
failed", so a recorded draw with such a set and a snapshotted input
was skipped.

Such a set now gets a pool sized to it (maxSets 1, no
FREE_DESCRIPTOR_SET_BIT), which Free destroys. Every set's count of
each type is first checked against the device's maxDescriptorSet*
limit; other descriptor types throw. The [descriptors] profile line
counts the dedicated pools.
@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
#1315 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp L1123, L1220, L2473-2474
#1318 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp L1123, L1220, L2473-2474
#1364 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L1189
#1366 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L1189

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on the merge with current main: build + ctest 434/434, agc_driver_graphics and agc_driver_oversized_descriptor_sets pass (the latter ran for real on RADV, not skipped), both fail without the change, CI green on the head, no conflicts. Dedicated pool sizing/flags/Free, the per-set limit check and the unsupported-type throw are pinned by the tests. Merging.

The PPSA26344 numbers are the author's and not reproduced here. #1184, #1201 and #1202 touch the same Allocate code and will need a rebase on top of this.

@adriadam10
adriadam10 merged commit 30e89cc into boykopovar:main Oct 8, 2026
4 checks passed
@Celegans12
Celegans12 deleted the fix/agc-oversized-descriptor-sets branch October 8, 2026 10:12
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