refactor(agc): retain immutable draw plans and local stage work #1311
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1311"
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 TibixDev on 2026-10-07T23:12:39Z.
Status after review
Needs redesign and an isolated benefit after prepared shaders.
I checked the current
materializeDrawStage/prepared-invocation path. The retained compile-result work in this branch targets the previous architecture and needs redesign, not conflict-marker cleanup. The existing 0.605 → 0.302 µs component result and combined-fork Skyrim run do not validate that redesign.The concrete downstream dependency issue is now removed: #1312 and #1313 have been rebuilt directly on main without this branch. They no longer need this stack to land. This branch's compare still includes two inherited #494 shape-cache commits in addition to its own change; that work must be reconciled or removed before a replacement is proposed. No code push here until the remaining retained work has an isolated current-main benefit.
What
Reuse immutable draw plans when only live shader inputs change. Keep temporary stage work in local storage and retain compiled results through recording.
Tested
Earlier branch-specific tests and measurements remain in the discussion. They have not been rerun on a redesigned current-main version of this PR. The review audit and shared NGS-assisted title exploration do not establish that this head is merge-ready. No full Linux/Windows platform CI was dispatched in this pass.
Checklist
Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-08T07:09:18Z.
Rebased on
c081eb90. Preserved merged #1134: non-indexed mesh draws use the null index descriptor. Adapted its simplified descriptor API to retained draw plans and kept the new graphics regression checks. The duplicate #493 prerequisite remains removed; #494 authorship is retained.Fedora 44 Release:
agc_driver_draw_plan_tests,agc_driver_tests,agc_driver_graphics_tests,agc_driver_pm4_tests,agc_shader_memory_testsbuild; the targeted tests and contribution checks pass. Windows CI is pending.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:21:58Z.
#639 replaced the draw path's compile step:
compileDrawStageis nowmaterializeDrawStage, built from invocations prepared at registration. This conflicts there, and the retained compile results need redoing on top of it. Please rebase onto current main (#1312 and #1313 follow), with numbers for this change alone against main.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T10:31:24Z.
Review: CHANGES_REQUESTED
Following up on the rebase request above: the branch conflicts with current
maininCMakeLists.txt,DrawCache.hpp,Driver.hpp,Draw.cpp,DrawCache.cpp,DrawCapture.cppandDrawDecode.cpp, because #639 moved shader compilation to registration.Draw.cpp/DrawCapture.cppsit on the old per-draw compile step. They need redoing on top of the prepared invocations from registration, not just a textual rebase.mainafter that. The current ones (0.605 → 0.302 µs) are a component benchmark, not a draw, and the in-game Skyrim comparison was on a combined fork, not this branch.Welcome to push the rebased version and we'll review it again.
Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-12T04:51:55Z.
Review-pass update:
I checked the current
materializeDrawStage/prepared-invocation path. The retained compile-result work in this branch targets the previous architecture and needs redesign, not conflict-marker cleanup. The existing 0.605 → 0.302 µs component result and combined-fork Skyrim run do not validate that redesign.The concrete downstream dependency issue is now removed: #1312 and #1313 have been rebuilt directly on main without this branch. They no longer need this stack to land. This branch's compare still includes two inherited #494 shape-cache commits in addition to its own change; that work must be reconciled or removed before a replacement is proposed. No code push here until the remaining retained work has an isolated current-main benefit.
I have updated the PR description to match this status. The PR remains open; the outstanding review requirements are not being marked resolved. AI-assisted audit.
Imported from boykopovar/AnyPS5. Originally posted by eliyarson on 2026-10-13T22:04:00Z.
Notes from a related experiment, in case they help with the "isolated benefit on current main" requirement. Nothing here is a review of the code.
Scene: Hades II hub, Linux, RTX 3080 Ti,
main665ad7da7,APS5_TRACE_SECONDS=150:30, game log not redirected to a file. Two captures ofmaingive frame p50 34.7 ms and 33.2 ms (28.9 and 30.1 FPS);queue worker 0x0is busy 98.7 % in both, so the single worker is what limits the scene. In the earlier capture ona0f5916a2(Driver.Packet34.3 ms per frame) the digest listsDriver.Draw.shader_compile_and_linkat 14.0 ms,Graphics.Draw.draw_and_resource_releaseat 10.3 ms andShader.DrawStageat 9.7 ms per frame. If the redesign removes the per-stageRecompileResultcopy and the per-draw heap vectors, that scene andshader_compile_and_linkare where its effect should show up in a trace pair.I had the same two cuts (no
RecompileResultcopy per captured stage, inline per-program arrays) in a local branch and dropped them so as not to implement the same functions as this PR. TheShaderMemoryrun-scan cuts do not overlap and are a separate small PR. Run-to-run spread on this machine is about 4 % between identicalmaincaptures, so a gain under that needs repeats before it counts.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T05:16:39Z.
Closing for now: it's parked for a redesign and conflicts with main, and the review points from 10-11 are still open. eliyarson's Hades II note above says where the gain should show (
Driver.Draw.shader_compile_and_linkwith the worker at ~99 %); reopen with a trace pair from that scene if you pick it up again. Thanks @eliyarson.Pull request closed