fix(agc): count a pixel stage's colour attachments against maxPerStageResources #1607
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1607"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by saarthakpant on 2026-10-08T14:15:33Z.
What
Fixes the TechnicalDebt entry "Per-stage descriptor count": a pixel shader's colour attachments were not counted against
maxPerStageResources, so a pixel stage whose buffers and images fit the limit could still give a pipeline that exceeds it.The Vulkan spec's definition of
maxPerStageResourcessays that for the fragment stage, the framebuffer colour attachments also count against the limit.ShaderResourcesbuild takes the draw's colour attachment count (state.colors.size(), the listPipeline.cppbuilds its colour attachments from). The fragment stage's resource total starts at that count, so its buffers and images are added on top of it. Going over the limit throws "shader descriptors exceed per-stage limits" as before. Vertex and compute stages start at 0, as before.#1580 edits the same
Requirechecks inShaderResources::buildPreparefor a different reason (update-after-bind limits), so whichever PR lands second needs a small rebase. Because this change seeds the fragment stage's total before those checks, the attachments would count againstmaxPerStageUpdateAfterBindResourcestoo, which the spec also requires.Tested
Windows 11, WinLibs GCC 15.2.0 (
15.2.0posix-14.0.0-ucrt-r7), AMD Radeon RX 9070 XT. Built with-DBUILD_TESTING=ON, then ran the full ctest suite.agc_driver_graphicshas a new case on the mock device, withmaxPerStageResources= 2:main(b58b1ccf): everything that covers this change passes, includingagc_driver_graphicsandagc_pipeline_cache. The suite has 641 tests, and the failures on this machine (RX 9070 XT, exFAT drive) are outside this change.guest_access,guest_filesystemandguest_file_timestampsfail on the filesystem. Six f16 ALU tests lose the sign of a negative zero:agc_driver_float16_misc,agc_driver_float16_modifiers,agc_driver_ldexp_f16_inline_constants,agc_driver_sdwa_float_selectors,agc_driver_sdwa_ldexp_f16andagc_driver_vop2_modifier_forms. All of these except the newly addedagc_driver_ldexp_f16_inline_constantswere confirmed to fail the same way onmainwithout this change. Thevideo_out_flip_*window tests are intermittent here: they usually skip and occasionally abort with heap corruption, with or without this change.tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T03:18:47Z.
This conflicts with main after today's merges; could you rebase? It passed testing and is otherwise ready.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T05:16:37Z.
Please rebase 8e6704a1 onto main and force-push instead of merging main into the branch (61d5bfe9); PR branches need to stay linear. The conflict resolution in
ShaderResources.cppis fine as it is.Imported from boykopovar/AnyPS5. Originally posted by saarthakpant on 2026-10-10T06:44:46Z.
Rebased onto main and force-pushed: the branch is now a single linear commit,
5b9fdd11.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T06:47:55Z.
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.
main)docs/dev/TechnicalDebt.mdL349docs/dev/TechnicalDebt.mdL349-350Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T07:25:17Z.
Rebase is linear now (single commit
5b9fdd11) and merges cleanly onto current main. Checked: ctest for libSceAgcDriver green on the merge result (agc_driver_graphics,agc_driver_prepared_graphics,agc_recorder_kept_bytes), the new case fails without the fragment-stage seeding, and the checks on the head are green; merging.