perf(agc): recorded draws to multisampled targets never build a recipe (Snoopy: ~55,000 per 10 s on the 33 µs template path) #26599
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 JJenkx on 2026-11-24T09:39:06Z.
What happens
A recorded draw never builds a
DrawRecipewhen it renders to a multisampled target (Graphics/src/Draw.cpp, the recipe condition's!multisampled && !pipeline->ReordersSamples()). Such draws stay on the template path every time they are drawn again.In Snoopy and the Great Mystery Club (PPSA28795), backyard,
multisampledis the largest reason by far: 53,000-58,500 per 10 s, against 21,000-30,000 forno outputand 5,000-16,000 recipes built. These are #11452's counters, measured on a local merge ontomainc5c9134731together with #26597. The full table is in my comment on #11452.[draws]per kind in the same windows: recipe hit 12 µs (~192,000), template hit 33 µs (~94,000). If the multisampled draws could take the recipe path, that would save roughly 21 µs × 55,000 ≈ 1.2 s of queue-worker time per 10 s on this title. The worker is 99 % busy and the GPU is idle about half of each frame (33.6 ms busy, 33.9 ms idle per frame, with #26597).Why it is excluded
The condition has been there since multisampled targets were added in
ebf361103c(feat(agc): multisampled color and depth targets with CB resolves), when multisampled draws could only be rendered as recorded draws. ADrawRecipe(Execution/include/Recipe.hpp) keeps weak references to its targets asGraphics::StorageTexture, their views, the framebuffer and the pass key, andDrawWithRecipeproves those still stand. Multisampled targets are bound through the multisample path (TargetBinding::multisampled), and their resolves and sample locations are handled after the draw. So supporting them needs, at least:I haven't found an issue or PR about this. I'm filing it as a measured lead, not a request for a specific design. Whoever owns the multisample path is best placed to say whether recipes can carry it safely.
System
Windows 11 Enterprise 22621, Ryzen 9 5950X, RX 6700 XT (AMD 26.11.2), WinLibs GCC 15.2 UCRT r7, Release,
APS5_PROFILE_DRAW=1.AI-assisted: yes.