Repository navigation
perf(agc): replay draws to native multisample color targets - #27849
oneandonlydean merged 4 commits into
Conversation
Keep the image and a weak reference to each multisample attachment. Reacquire it through the live target registry to apply pending writes and clears and verify the image and view before recording. Retired or recreated attachments take the ordinary draw path. AI-assisted: Codex + GPT-6.2 Astra (xhigh)
Fall back to normal target acquisition when a texture must take fresh register state. Preserve the upstream texture import check before recreating an owner. AI-assisted: Codex + GPT-6.2 Astra (xhigh)
…rgets Keep the current key check before recording a reusable draw and retain the GCN texture ownership check when creating an attachment. AI-assisted: Codex + GPT-6.2 Astra (xhigh).
AI-assisted: Codex + GPT-6.2 Astra (xhigh).
|
No actionable comments were generated in the recent review. Walkthrough
Change: Refactor Merge Risk:
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The change at head 8eb7c6cc19024eaf73b4411f4ee2acfe91e8954d adds 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
| Check | Result | Note |
|---|---|---|
| Patch and changed source review | passed | Six changed files inspected |
| Build and tests | not run | Author reports tests; not independently verified |
Findings
Blocking
None.
Non-blocking
None.
Not verified
No checks were executed. I read all six changed files marked included in the manifest: Recipe.hpp, MultisampleTarget.hpp, Draw.cpp, MultisampleTarget.cpp, TargetStateMemo.cpp, and agc_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.
|
This pull request is labeled |
|
The Snoopy and the Great Mystery Club backyard comparison (PPSA28795, #26599) is still open. I don't have a capture of that scene on both builds. The original report measured recipe misses on an instrumented build. The effect of this PR on frame times in that scene is still unknown. If someone with the title can capture the backyard, one reproducible pair is main at For reference, I reran the repository's digest tool on all four archived synthetic 4× MSAA traces. All four outputs matched their archived digests. These project-shader runs cover 10 presents at 64×4 on the earlier
AI-assisted: Codex + GPT-6.2 Astra (xhigh). |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Windows at this head ( Setup:
The added test lines have no platform guard. AI-assisted: yes. |
Plyxen
left a comment
There was a problem hiding this comment.
I read the diff at 8eb7c6cc19. Windows 11, GCC 15.2, merged into main at daa61711afe together with other open PRs (so not an isolated build), with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 and VK_LAYER_KHRONOS_validation on 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.- Control (the same tree with only this PR's source change taken out):
agc_driver_multisample_color_recipefails with "the native multisample color draw did not build a recipe".
The red windows check is a cancelled run.
Not checked: the timings in the body, and a title.
AI-assisted: yes (Claude Code)
ligmaSec
left a comment
There was a problem hiding this comment.
RepeatMultisampleTargetView sets drawn and increments contents while checking each attachment. A later attachment miss, resource proof miss, or expired pipeline can then return Rebuild before 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 onto 6ef4f2f73b. Focused Linux checks are queued.
AI-assisted: yes.
boykopovar#27849 gave DrawWithRecipe a branch for native multisample color targets; the claim stays in front of the single-sample target's lookup. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011TXsSW8zeAgKgHLCFsYwM3
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