perf(agc): recorded draws to multisampled targets never build a recipe (Snoopy: ~55,000 per 10 s on the 33 µs template path) #26599

Open
opened 2026-11-24 09:39:06 +00:00 by JJenkx · 0 comments
JJenkx commented 2026-11-24 09:39:06 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-24T09:39:06Z.


What happens

A recorded draw never builds a DrawRecipe when 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, multisampled is the largest reason by far: 53,000-58,500 per 10 s, against 21,000-30,000 for no output and 5,000-16,000 recipes built. These are #11452's counters, measured on a local merge onto main c5c9134731 together 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. A DrawRecipe (Execution/include/Recipe.hpp) keeps weak references to its targets as Graphics::StorageTexture, their views, the framebuffer and the pass key, and DrawWithRecipe proves 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:

  • a target identity and proof for multisampled targets;
  • the same post-draw resolve and dirty-state bookkeeping on the recipe path that the recorded path does.

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.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6578882809 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/26599). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-11-24T09:39:06Z. --- ### What happens A recorded draw never builds a `DrawRecipe` when 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, `multisampled` is the largest reason by far: **53,000-58,500 per 10 s**, against 21,000-30,000 for `no output` and 5,000-16,000 recipes built. These are #11452's counters, measured on a local merge onto `main` `c5c9134731` together with #26597. The full table is in [my comment on #11452](https://github.com/boykopovar/AnyPS5/pull/11452#issuecomment-7127675082). `[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. A `DrawRecipe` (`Execution/include/Recipe.hpp`) keeps weak references to its targets as `Graphics::StorageTexture`, their views, the framebuffer and the pass key, and `DrawWithRecipe` proves 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: - a target identity and proof for multisampled targets; - the same post-draw resolve and dirty-state bookkeeping on the recipe path that the recorded path does. 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.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#26599
No description provided.