perf(agc): replay draws to native multisample color targets #27849
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27849"
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 RavenCurseBurg on 2026-11-27T15:26:52Z.
What
For #26599, allow direct draws to native multisampled color targets to reuse their recorded commands. Replay verifies each attachment against the live multisample registry and retains its image through command recording. Retired and replaced attachments use the ordinary draw path.
Tested
I tested the synthetic 4× MSAA scene after integrating #21479. Against
65ff3ae335ac, the integrated candidate2e566609eeaereduced median CPU recording time on the RTX 4060 from 2.55 to 1.81 µs/draw with one color target and from 3.03 to 2.06 with two. On the UHD 770, the corresponding results were 2.61 to 1.99 and 3.51 to 2.12. Each comparison used 8,064 steady-state draws per revision and verified readback. Inline and pipelined PM4 runs both went from zero to 64 recipe hits on each GPU, with 64 draw-cache hits throughout.For the existing single-sample fast path, the paired candidate/base recording-time ratios were 1.012 on NVIDIA (95% interval 0.935–1.097) and 0.954 on Intel (0.878–1.042). The identical-binary Intel control also varied. All 145 shared CTests retained their outcomes on each adapter, and the added regression passed. Retiring and reacquiring a DCC texture at the same address passed twice per adapter at 2×, 4× and 8×. A Snoopy capture on the reporting RX 6700 XT is still needed to measure title frame time. Both revisions' traces, measured batches and reproduction instructions
The branch merged cleanly with main at
102cad67da. The overlap checker examined 2,676 open PRs. I compared the four flagged line overlaps and 52 branches that could not merge with main. #19686, #21479 and #25802 change attachment acquisition and layout. #27273 changes draw-key ownership. #11452 adds counters. The reported patches contain no implementation of live native MSAA recipe replay. The tested counter integration is available for the reporter's Snoopy run.I merged the upstream DCC texture import change (#21479) at
65ff3ae335acand compared the resulting code with that main commit. All 145 shared CTests retained identical outcomes per GPU. The added recipe test passed on both. The RTX 4060 had 143 passes, two skips and one baseline failure. The UHD 770 had 142 passes, one skip and three baseline failures. Both adapters passed all six initial DCC and target takeover cases. A separate native Vulkan check reimported a DCC texture at the same address while retaining its old owner. The old attachment refused replay and the newly acquired attachment replayed. Readback preserved the expected color. This passed twice per adapter at each of 2×, 4× and 8× MSAA with Khronos validation. Integrated codeI rechecked the merge of main
80781a0e94in6344fbd213. Recipe creation requires a content key, and ordinary target acquisition keeps main's GCN texture ownership check. On each of the RTX 4060 and UHD 770, all 151 shared CTests retained their outcomes and the additional multisample recipe test passed. The Vulkan validation logs showed no additional diagnostics. Benchmarks and regression results for this revisionI merged upstream
363e0bed4definto the submitted branch and checked the resulting tree. The project’s code and PR conventions passed.I checked the current GPU overlaps. #9508 changes descriptor-heap handling and #20315 changes host imports. #9897 changes the CheckBufferAliases call next to the multisample feedback guard. If #9897 merges first, I will retain the guard and pass its maxVertex argument to CheckBufferAliases when refreshing this branch.
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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T15:33:57Z.
Review: APPROVED
Reviewed — looks good
The change at head
8eb7c6cc19024eaf73b4411f4ee2acfe91e8954dadds multisample draw recipe replay with live attachment validation; the inspected implementation and regression scenario show no verified blocking defect.What I ran
Read the prepared diff and source context through
repo_read.py; no build or test command was run. The author reports benchmark, CTest, and GPU validation results in the PR description; these were not independently run for this review.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No checks were executed. I read all six changed files marked
includedin the manifest:Recipe.hpp,MultisampleTarget.hpp,Draw.cpp,MultisampleTarget.cpp,TargetStateMemo.cpp, andagc_driver_target_memo_tests.cmake. The manifest lists no excluded changed files. GPU behavior and reported performance measurements were not independently confirmed.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T12:38:04Z.
Review: APPROVED
I read the diff at
8eb7c6cc19. Windows 11, GCC 15.2, merged intomainatdaa61711afetogether with other open PRs (so not an isolated build), withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1andVK_LAYER_KHRONOS_validationon an RTX 5080 (621.24) and a Radeon iGPU (26.11.2).agc_driver_multisample_color_recipeand the multisample tests: pass on both GPUs. The loader log shows the layer inserted and no "was not found" line, and neither run has aVUID-orSYNC-HAZARDline.agc_driver_multisample_color_recipefails with "the native multisample color draw did not build a recipe".The red
windowscheck is a cancelled run.Not checked: the timings in the body, and a title.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T20:55:18Z.
Review: COMMENTED
RepeatMultisampleTargetViewsetsdrawnand incrementscontentswhile checking each attachment. A later attachment miss, resource proof miss, or expired pipeline can then returnRebuildbefore recording a draw, leaving earlier targets with an advanced content stamp. Could the recipe verify its attachments first and mark them drawn when it commits to recording? A two-target fixture with only the second target retired would exercise this path.Source review at
8eb7c6cc19. The head trial-merges onto6ef4f2f73b. Focused Linux checks are queued.AI-assisted: yes.