perf(agc): drain for a depth render control only when it can update a surface #16168
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16168"
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-05T19:04:20Z.
What
Before a draw,
DrawPrecheckdrains the draw pipeline when the draw'sDB_RENDER_CONTROLdecodes as a depth render control and either:0x60), orThe drain exists so that
NoteDepthRenderControl(the in-place expand tracking from439557b223) updates a surface no queued draw still reads.NoteDepthRenderControlonly changes active surfaces with more than one sample, the draw's sample count and the draw's address. It never changes anything for a single-sample control, and nothing for a clear-only control on a surface it does not match. Those draws drained for nothing.The condition is now
DepthRenderControlDrains:Tested
Linux 7.2.11, GCC, Release, RX 6650 XT (RADV Mesa 26.2.6), on
mainfc23faa40a.agc_driver_native_depth_expand_gate(CheckExpandGate) now checks the predicate. For a native multisample target it expects:All 6 cases ran (2, 4 and 8 samples, each with and without a stencil plane).
agc_driver_native_multisample_depth,agc_driver_native_depth_expand_gate,agc_driver_depth_copy_draw,agc_depth_copy_kept_bytes: 4 of 4 pass, 3 runs each.ctest -R "^agc_|^video_out|vulkan": 1,368 of 1,368 pass.Drains, from
APS5_PROFILE_DRAW=1, one profiled run on each build per title, same base:main0x27) drains per 10 s0x27) drains per 10 sA local counter, not part of this change, attributed these drains: the depth render-control drain fired more than 131,000 times in a 95 s run. The metadata-pass drain fired about 1,000 to 2,000 times. Every sampled depth render-control drain had
DB_RENDER_CONTROL0x00000020with a single sample.No performance claim. Removing the drains did not measurably change frame rate. Eight unprofiled runs per title, alternating in two orders against
mainfc23faa40a:mainOn PPSA27616 the first order showed +4% and the reversed order −0.3%, so the +1.8% overall is not confirmed. On PPSA20423 the first order favoured
mainand the reversed order favoured this change; both builds range from 14 to 19.5 FPS. With fewer drains, the worker now runs while the committer records, instead of waiting for it. In these scenes the committer is the limit, so frames do not get shorter.Screenshots at 115 s in PPSA20423 are identical apart from the animated water.
Performance
Summary lines of the second capture pair, PPSA27616 on the same machine and scene,
mainfc23faa40aa4then this changea3ffd3196921(APS5_TRACE_SECONDS=20:40). The capture comment has all four captures, thetools/performance_compare.pytables and thetools/trace_digest.pyoutput. Mean frame time is about 1% shorter, close to the spread between captures of one build, so this is not a speedup claim.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)